一、运行错误
Android获取toast,需要在参数里设置automationName:Uiautomator2
# 设置设备的信息
desired_caps = {
'platformName': 'Android', # 平台
'platformVersion': '5.1', # 版本号
'deviceName':
'appPackage':
'appActivity':
'unicodeKeyboard': 'True', # 防止键盘中文不能输入
'resetKeyboard': 'True', # 重置设置生效
'automationName': 'Uiautomator2',
'noSign':'True'
}
在参数里设置后,运行脚本,提示Uiautomator2错误, 后经查询appium1.6.3以上才能识别toast,
于是去github官网下载最新版本:https://github.com/appium/appium-desktop/releases,仍未解决;
几经折腾最后发现在安装appium-desktop的时候需要将安装模式设置为只为此用户安装,运行后没有在提示错误,正常运行