Using a precompiled libadb:
$ make
Compiling locally:
$ make LIBADB_LOCATION=local
$ make run BIN=<PATH TO FIREFOX BINARY>
$ make test BIN=<PATH TO FIREFOX BINARY>
Use the environment variable ADB_TRACE with flags defined in adb_trace_init()
in adb.cpp e.g. ADB_TRACE=all
.
Add --no-run
as an argument to cfx
in the run target in the makefile.
This will then dump the command to run Firefox when make run
is used.
Start lldb/gdb
$ lldb -- <COMMAND FROM ABOVE>
Main (adb.js) - Starts and shuts down all the various workers below. Also, responsible for forwarding events on.
Server (adb-server-thread.js) - The worker is mainly responsible for initialization and receiving messages such as when a device status changes or starting the IO threads when a device is connected to. It loops forever until the kill server file descriptor is written to, which happens on the main thread.
Device Poll (adb-device-poll-thread.js) - This thread is only responsible for starting a polling loop that looks for new device connections (not on Linux, Linux uses pthreads). The C code does not send message directly back to this thread when devices are connected, it instead will send an event to the server thread. It is terminated when kill_device_loop is called.
File Descriptor IO (adb-io-thread.js) - Used for reading and writing to file descriptors.
Utility (adb-utility-thread.js) - Currently only used for queries where you ask ADB for a service and it will return a file descriptor to communicate with that service e.g. shell or port forwarding (See SERVICES.TXT).
Device Input & Output (adb-io-thread-spawner.js) - These workers are used as an IO pump reading and writing data to a device. They share the same code.
- android-tools/adb-bin/OVERVIEW.txt
- android-tools/adb-bin/protocol.txt
- android-tools/adb-bin/SERVICES.txt