提出问题
当 ADB 连接了多台设备之后,每次敲个什么命令都得指定-s serial
, 否则就是一顿error: more than one device/emulator
, 每次忘了敲都得重复一遍以下流程:
→ adb shell
error: more than one device/emulator
→ adb devices
List of devices attached
L830c97b0 device
014dd229c9c2 device
→ adb -s L830c97b0 shell
h1:/ $
然后
→ adb -s L830c97b0 shell
h1:/ $
h1:/ $ ^D
→ adb push 0day.zip /sdcard/
adb: error: failed to get feature set: more than one device/emulator
最后我决定把另外一台手机拔掉。。。
解决提出问题的人
只要在你的~/.bash_profile
或~/.zshrc
或者其他profile
里加上两行代码,就可以实现比较方便的 adb 设备切换。
adbs(){export ANDROID_SERIAL=$1; echo " 33[32m[adb-select] current device <$ANDROID_SERIAL>
评论