My goal is to write an app which runs on a handset and lets the user choose from a list of APK\'s, then installs the one selected to an Android Things device on the same net
The problem is that the adb
client (which you use to communicate to the ADB server which communicates to and from a device on a development machine) is not packaged on an Android device. The adbd
daemon, however, (used to communicate between the adb
client and the device) can and will be found on an Android system.
There are a few options to help use the adb
client on an Android device:
adb
client for an Android device from the adb sources on GitHub.adb
"client". Since the adb
client and adbd
daemon communicate via USB or TCP, you could try emulating the communication protocols to open read/write streams on the device. More on the client-daemon communication protocols here. This library that I am working on might help you: eviltak/adb-nmapThe quick and dirty option is to build the adb
client from sources and push to the device. That is, if you can get it to build on an Android device.
The second option is probably the most time consuming, but can be the most "clean" choice. You will, however, have to emulate the adb
authentication system, properly handle streams and so on, which can be cumbersome. The source will help you.
In either case, the GitHub adb
source directory should have everything you need for the long road ahead.