Debugging

debug (1) adb (1)
Alvin Wong

Debugging

Debug using ADB (Android Debug Bridge)

ADB is a very convenient debugging method. It can be used to transfer files between the device and the computer, run commands as root and view system logs (dmesg/logcat).

ADB is included in the Android SDK, or built when building from Android source code (together with the root filesystem). If you just built from Android source code, you'll get ADB at <root>/out/host/linux-x86/bin/adb, that is $ANDROID_HOST_OUT/bin/adb. It is also set to $PATH when built so you can just type adb to get it started.

A detail of the commands can be seen here: http://developer.android.com/guide/developing/tools/adb.html

ADB via WiFi

Add setprop adb.tcp.port 5555 to init.rc. This will make ADB listen to port 5555.

Switch on WiFi and connect to your AP. Get the IP by pressing the AP. Sit on your computer and execute adb connect <ip> and you should be connected to your device already.

Do note that this method may creates a security problem as anyone that can reach your IP will be able to use ADB on your device. As ADB has root access by default, your device can get screwed.

ADB via USB

NOTE: The USB gadget support in the kernel is not available, so information here can be misleading. You cannot debug via USB at the moment.

Plug your device to the computer.

Debug by saving a log file (logcat)

In init.ipaq214.rc, you can see a few lines commented. remove them to enable logging. The log file is saved as logcat.log. You need to modify the permission before opening it the first time, or you can create the file before first boot. It's very likely that logcat is run as root, so you don't need to care about it so much.

Debug in the Terminal Emulator

What you can do is to execute dmesg. You can save it to a file by dmesg>foo.bar, given that you've created the file foo.bar already with write permission for anyone.


Related

Wiki: Developing