Apr 29, 2021
Hi! It is possible. Let's consider a TCP Server running on an emulator. You need to forward the TCP port (e.g. 1234) of the host PC to the emulator with the following command:
"adb forward tcp:<port> tcp:<port>".
Then you can pass a data from any client to the emulator just as sending data from any client to the host PC.
<IP> is the host PC IP.
"adb forward tcp:<port> tcp:<port>"
"nc <IP> <port> < something.txt"
This will pass the data to socket port of the emulator.
Check this: https://developer.android.com/studio/command-line/adb#forwardports