- 當我連着手機充電的時候,啟動模擬器調試,執行ADB指令時,報錯。
C:\Users\Alexander>adb shell
error: more than one device and emulator
C:\Users\Alexander>adb install e:\good.apk
error: more than one device and emulator
- 碰到這種情況,首先要查一下,是不是真的有多個設備或模擬器。
C:\Users\Alexander>adb devices
List of devices attached
emulator-5554 device
4dfadcb86b00cf05 device
- 發現還真是多個設備,那就需要為ADB命令指定設備的序列號了。
C:\Users\Alexander>adb -s emulator-5554 shell
-
也就是如上所示,給命令加上-s的參數就可以了!
-
如果實際上只有一個設備或模擬器,並且查到有offline的狀態;那就說明是ADB本身的BUG所導致的,就需要用如下的方法處理下了:
C:\Users\Alexander>adb kill-server
C:\Users\Alexander>taskkill /f /im adb.exe
- 第一條命令是殺ADB的服務,第二條命令是殺ADB的進程!
- 如果第一條沒有用,才考慮用第二條命令再試試看的!
作者:艾孜爾江