1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #coding:utf-8 #pip install pyyaml import yaml import os desired_caps = { 'platformName' : 'Android' , 'platformVersion' : '7.0' , 'deviceName' : 'ASRNW1111111111' , 'appPackage' : 'com.tencent.com' , 'appActivity' : 'ui.LauncherUI' , 'automationName' : 'Uiautomator2' , 'unicodeKeyboard' : True , 'resetKeyboard' : True , 'noReset' : True , 'chromeOptions' : { 'androidProcess' : 'com.tencent.com' } } curpath = os.path.dirname(os.path.realpath(__file__)) yamlpath = os.path.join(curpath, "cfgyaml.yaml" ) def read_yml( file = yamlpath): with open ( file , 'r' , encoding = 'utf-8' ) as f: return yaml.load(f.read(), Loader = yaml.FullLoader) def write_yml( file ,data): with open ( file , 'w' , encoding = "utf-8" ) as f: yaml.dump(data = data, stream = f,allow_unicode = True ) if __name__ = = "__main__" : write_yml(yamlpath,desired_caps) result = read_yml() print (result) #{'appActivity': 'ui.LauncherUI', 'appPackage': 'com.tencent.com', 'automationName': 'Uiautomator2', 'chromeOptions': {'androidProcess': 'com.tencent.com'}, 'deviceName': 'ASRNW1111111111', 'noReset': True, 'platformName': 'Android', 'platformVersion': '7.0', 'resetKeyboard': True, 'unicodeKeyboard': True} |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
2021-05-30 linux连接工具MobaXterm下载及使用