消除ADB錯誤“more than one device and emulator”的方法(轉)


當我連着手機充電的時候,啟動模擬器調試,執行ADB指令時,報錯。
C:\Users\gaojs>adb shell
error: more than one device and emulator
C:\Users\gaojs>adb install e:\good.apk
error: more than one device and emulator

碰到這種情況,首先要查一下,是不是真的有多個設備或模擬器。
C:\Users\gaojs>adb devices
List of devices attached
emulator-5554   device
4dfadcb86b00cf05        device
發現還真是多個設備,那就需要為ADB命令指定設備的序列號了。
C:\Users\gaojs>adb -s emulator-5554 shell
也就是如上所示,給命令加上-s的參數就可以了!

如果實際上只有一個設備或模擬器,並且查到有offline的狀態;
那就說明是ADB本身的BUG所導致的,就需要用如下的方法處理下了:
C:\Users\gaojs> adb kill-server
C:\Users\gaojs> taskkill /f /im adb.exe
第一條命令是殺ADB的服務,第二條命令是殺ADB的進程!
如果第一條沒有用,才考慮用第二條命令再試試看的!
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM