Android 2.2手机
1) 在终端运行 lsusb会发现结果有会有如下类似记录:Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 005: ID 1219:0102 #这行就是 手机Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 这时键入sudo gedit /etc/udev/rules.d/53-android.rules在打开的文件中增加以下文本:SUBSYSTEM=="usb", SYSFS{idVendor}=="1219", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="1219", ATTR{idProduct}=="0102", SYMLINK+="android_adb"2) 运行以下命令:sudo chmod a+rx /etc/udev/rules.d/53-android.rulessudo /etc/init.d/udev restart3) 在 android sdk 的 tools 目录下运行 (这一步很重要,必须要sudo,否则没效果)sudo ./adb kill-serversudo ./adb devices然后,就可以直接用 adb shell来进行操作了。
Android 3.0平板
[email protected]:~/android-sdk-linux_x86/tools$ ps -aux | grep adbWarning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.htmldeanye 1821 0.0 0.0 44572 1184 ? Sl 12:44 0:00 adb fork-server serverdeanye 5787 0.0 0.0 5628 772 pts/1 S+ 13:11 0:00 grep --color=auto adb[email protected]:~/android-sdk-linux_x86/tools$ kill -9 1821[email protected]:~/android-sdk-linux_x86/tools$ ps -aux | grep adbWarning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.htmldeanye 5791 0.0 0.0 5624 772 pts/1 S+ 13:11 0:00 grep --color=auto adb[email protected]:~/android-sdk-linux_x86/tools$ lsaapt adb_has_moved.txt android apkbuilder dexdump draw9patch emulator hierarchyviewer layoutopt llvm-rs-cc monkeyrunner proguard sqlite3 zipalignadb aidl ant ddms dmtracedump dx etc1tool hprof-conv lib mksdcard NOTICE.txt source.properties traceview[email protected]:~/android-sdk-linux_x86/tools$ sudo adb fork-server serversudo: adb: command not found[email protected]:~/android-sdk-linux_x86/tools$ ps -aux | grep adbWarning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.htmldeanye 5797 0.0 0.0 19984 928 ? Sl 13:11 0:00 adb fork-server serverdeanye 5819 0.0 0.0 5624 768 pts/1 S+ 13:12 0:00 grep --color=auto adb[email protected]:~/android-sdk-linux_x86/tools$ kill 2797bash: kill: (2797) - 没有那个进程[email protected]:~/android-sdk-linux_x86/tools$ kill -9 5797[email protected]:~/android-sdk-linux_x86/tools$ ps -aux | grep adbWarning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.htmldeanye 5821 0.0 0.0 5624 772 pts/1 S+ 13:12 0:00 grep --color=auto adb[email protected]:~/android-sdk-linux_x86/tools$ sudo ./adb fork-server serverOK[email protected]:~/android-sdk-linux_x86/tools$ sudo ./adb fork-server server &[1] 5825[email protected]:~/android-sdk-linux_x86/tools$ OK