1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 遇到“more than one device/emulator”解决方法

遇到“more than one device/emulator”解决方法

时间:2020-08-23 02:44:26

相关推荐

遇到“more than one device/emulator”解决方法

我们在查看当前App界面的界面和包名时,会出现以下情况:

C:\Users\silence>adb shell dumpsys window windows | findstr mFocusedApperror: more than one device/emulator

此时说明我们连接的设备不止一台,不能显示具体的界面和包名

解决方案:

我们在执行adb命令的时候,指定设备就行:

命令格式:adb -s xxxxxx shell ,其中XXXXXX就是我们想要连接的设备名称

如果实际上只有一个设备或者模拟器,并且有offline的状态,就证明是ADB本身的BUG导致:

需要使用以下命令来解决:

adb kill-server:这条命令是杀掉ADB服务

然后使用adb devices查看当前设备的连接情况,情况正常就可以调用相应的命令来操作

我在使用连接的时候,出现一个低级的错误,一直不能连接成功:

error: activity and pkg are required to start an application

究其原因,是我将“appActivity”输入成了“appAction”

desired_caps["deviceName"] = "emulator-5554"desired_caps["platformName"] = "Android"desired_caps["platformVersion"] = "5.1"desired_caps["appPackage"] = "com.android.settings"# desired_caps["appAction" ] = ".Settings "desired_caps["appActivity"] = ".Settings"

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。