I want to use adb to install apps to my Android-based TV from an Android phone rather than a computer.
So I decide to read adb source code, port the adb code and compile it to a library file (libadb.so) and then invoke it by JNI from within an Android app.
When I test this apk on my telephone, the adb server fails with can not bind 'tcp:5037'
port.
I thought the failure to open that port might be a conflict with the existing implementation of ADB which might be using it, so I removed that. It didn't work. I tried to change to other ports, such as 4097,or 6066. It still didn't work. I have no further ideas how to solve this problem.