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