2013年10月22日 星期二

查看 adb log


/home/moose/n912/android/out/host/linux-x86/bin

裡面會有許多 執行檔

只要把adb 執行檔 ,丟入/usr/local/bin 

就可以執行 adb logcat

2013年10月10日 星期四

adb devices no permissions 的解決方法

http://astone-working.blogspot.tw/2012/09/adb-devices-no-permissions.html

使用adb devices 出现如下:
List of devices attached
???????????? no permissions

解决方法:
1. 找出usb vid,pid
$ lsusb      #列出usb device內容
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 192f:0916 Avago Technologies, Pte.
Bus 003 Device 002: ID 0e8f:0022 GreenAsia Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 005: ID 18d1:4e26
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

只要插入usb device查乙次,拔出usb device查詢一次,比較差異就可以知道我們要的usb device是哪一個。
如:
Bus 003 Device 002: ID 0e8f:0022 GreenAsia Inc.
其中的0e8f就是vid,0022就是pid.

2. 編輯權限
$ sudo vim /etc/udev/rules.d/70-android.rules
加入以下內容
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e8f", ATTRS{idProduct}=="0022",MODE="0666" 

3. 重新啟動 udev service
$ sudo chmod a+rx /etc/udev/rules.d/70-android.rules 
$ sudo service udev restart 

4. 重新啟動 adb
$ sudo ./adb kill-server 
$ ./adb devices

完成