Wednesday, October 16, 2013

How to solve adb server is out of date issue

I was facing the adb issue yesterday after reboot my laptop.
>adb devices
adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *
error: unknown host service



Finally, here is the solution:
Step1: find if the adb port is occupied
> netstat -ano |grep 5037
 TCP    127.0.0.1:5037         127.0.0.1:65151        ESTABLISHED     6980


Step2: find the process name
>>tasklist /fi "pid eq 6980

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
tadb.exe                      6980 Console                    1      5,112 K

Step3: kill that process (tadb.exe for this case)

How to use tcpdump on Android devices


>adb push tcpdump /sdcard/tcpdump
>adb shell
>su
>cp /sdcard/tcpdump /data/local/tcpdump
>chmod 6755 /data/local/tcpdump
>cd /data/local
>/data/local/tcpdump -p -vv -s 0 -w /sdcard/capture.pcap
ctl+c
>adb pull /sdcard/capture.pcap c:\

Tuesday, July 24, 2012

How to connect to unknown android device using USB

>adb devices
List of devices attached
emulator-5554    device
????????????    no permissions

which means this device is unknown to adb yet.

try to find it is device id
>lsusb
Bus 001 Device 006: ID 19d2:0287 ONDA Communication S.p.A.

19d2 is the vendor id, 0287 is the product id.

>sudo /etc/udev/rules.d/51-android.rules
add a new entry at the end with vendor/product id above

>sudo restart udev

>adb kill-server
>adb start-server
>adb devices
List of devices attached
emulator-5554    device
04507242439fb497_MTPADB    device