python 代码无法启动模拟器中的应用怎么办

搞了七八个小时终于解决了,记录以下
代码
from time import sleep
from appium import webdriver
desired_caps = dict()
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘platformVersion’] = ‘5.1’
desired_caps[‘deviceName’] = ‘192.168.38.101:5555’
desired_caps[‘appPackage’] = ‘com.android.settings’
desired_caps[‘appActivity’] = ‘.Settings’
driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)
sleep(4)
driver.quit()

开始的时候一直打不开手机里面的应用。
Appium报错:UiAutomator exited unexpectedly with code 0, signal null
解决办法:
1.adb shell 命令进入shell模式
adb shell
2.输入命令:cd data/local/tmp
3.然后输入ls查看当前文件
4.将当前文件AppiumBootstrap.,更改为AppiumBootstrap.jar
mv AppiumBootstrap. AppiumBootstrap.jar
5.问题解决

猜你喜欢

转载自blog.csdn.net/ht17826836901/article/details/114847149