【解决方法】error: more than one device/emulator

背景

搞点 Android 小工具,开发过程中需要 adb 调试。

但是执行某条 adb 指令之后就报标题的错:

error: more than one device/emulator

原因分析

很简单,报错说的很清楚,有多个设备同时连接了电脑。

解决方法

解决方法也很简单,执行 adb 指令的时候,指定执行的设备,就OK了。

比如:

adb -s xxxxxx shell ps 21190

其中的 xxxxxx 就是你的设备序列号(serial number)。

获取序列号的方法,执行 adb devices

mac-mini.lan ~ adb devices
List of devices attached
ENU7N1632353	device
FA6BS03	device
eaafdefbdd	device

可以看到,我现在的电脑一共连了三个手机。

好了。

打完收工。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章