參考官方說明 在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