I am creating a debugging plugin in for Android Studio, and this will start a server and listen to a port. The device(mobile with adb deamon running) connected via USB.
And my application will send some files, requests, logs simply data to a port. This is my concept.
So I want to send it through USB. While some digging I found ADB port forwarding/reversing is the answer for this. But I didn't understand the whole concept of port forwarding using adb.
Am I want to start
ServerSocket
on both developing machine and mobile?If So, I started
ServerSocket: on port 8080
and deviceServerSocket: on 9090
then executeadb forward tcp:8080 tcp:9090
will be diverted to8080
that is on developing machine?How they forward or redirect to machine port?
How to execute adb commands from java code?
The ultimate aim is I want to communicate with my application/library from phone to developing machine.
I am a noob on networking and this kind of things.
Thanks in advance.