Ubuntu/Linux setup device/android for adb
在Ubntu下开发Android开发调试JNI比Windows下用Cygwin方便,现总结下简单配置
-
In the
AndroidManifest.xml
file, addandroid:debuggable="true"
to the<application>
element. -
Enable USB debugging on your device
-
Set up your system to detect your device
-
添加一个相应规则 create this file:
/etc/udev/rules.d/51-android.rules
从官方查 ,比如华为是12d1
SUBSYSTEM=="usb", ATTR{idVendor}=="
", MODE="0666", GROUP="plugdev" -
Now execute:
chmod a+r /etc/udev/rules.d/51-android.rules
-
restart adb
adb kill-serveradb devices # start and list deivces
-
-
重新插拔设备
-
问题:
adb devices
看不到设备,一般是Android手机ProjectMenu
中Log
与usb port set
设置问题。以华为C8812为例:拨号*#*#2846579#*#*
进入试菜单界面,设置log
为verbose
并dump log
,usb port set
设为Google mode
# not work~/adb devicesList of devices attached ???????????? devices#orList of devices attached
# adb devices works~/adb devicesList of devices attached 0C37DC322826 devices