Run adb on the device itself, i.e. as if it were the PC issuing the commands

前端 未结 1 1205
我寻月下人不归
我寻月下人不归 2020-12-30 10:14

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

相关标签:
1条回答
  • 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:

    • Try and build the adb client for an Android device from the adb sources on GitHub.
    • Try and make a makeshift 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-nmap

    The 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.

    0 讨论(0)
提交回复
热议问题