[zhangjiayuan@localhost moodlemobile2-old]$ adb devices
List of devices attached
TA09004QEA no permissions
发现linux adb已经连接上我的设备,但是没有权限
解决:
(1)先关闭adb服务:
[zhangjiayuan@localhost moodlemobile2-old]$ adb kill-server
(2)查看adb路径:
[zhangjiayuan@localhost moodlemobile2-old]$ whereis adb
adb: /opt/android-sdk-linux/platform-tools/adb
(3)使用root重新开启服务:
[zhangjiayuan@localhost moodlemobile2-old]$ sudo /opt/android-sdk-linux/platform-tools/adb start-server
(4)权限问题已经解决:
[zhangjiayuan@localhost moodlemobile2-old]$ adb devices
List of devices attached
TA09004QEA device
可以使用adb命令安装apk到手机上了:
[zhangjiayuan@localhost 桌面]$ ls
1.png android-debug.apk
[zhangjiayuan@localhost 桌面]$ adb install android-debug.apk
7413 KB/s (7017209 bytes in 0.924s)
pkg: /data/local/tmp/android-debug.apk
Success
说明: 如果在命令行中直接使用adb,需要在环境变量中配置adb。
参考:http://blog.sina.com.cn/s/blog_6039286701013eyv.html