参考原文:http://wangwei121004-163-com.iteye.com/blog/1262003
通过sudo -s切换到root下,
wangpan@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env$ sudo -s
使用type adb来查看下adb用的是那个命令,此时命令行显示的是/home/wangpan/android/android5.0/android-sdks/platform-tools/adb
root@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env#type adb
退出
root@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env# exit
wangpan@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env$cd /usr/bin
删掉原来的adb,如果这个目录下面没有adb,可以不操作这个命令
wangpan@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env$rm -rf adb
创建一个指向自己adb的链接
wangpan@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env$sudo ln -s /home/wangpan/android/android5.0/android-sdks/platform-tools/adb
wangpan@wangpan-System-Product-Name:~/work/buildEnv20160421/build_apk_env$type adb
此时命令行显示的是 adb 是 /usr/bin/adb
这样问题就解决了。