$ adb forwards tcp:5039 tcp:5039
If you want to forward device files in Android devices, such as /dev/input/event0, you can do this:
$ ADB forward TCP:800 1 dev:/dev/input/event 0
In this way, you can read and write /dev/input/event0 in Android devices by reading and writing tcp port 800 1 on your computer.
Verification:
You can refer to system/core/libutils/socket _ network _ client.c to quickly create a socket client program:
int FD = socket _ network _ client(" 127 . 0 . 0 . 1 ",800 1,SOCK _ STREAM);
while (true) {
Unsigned character buffer [1024];
int len = recv(fd,buffer, 1024,0);
//Dump buffer information ...
}
65438+
2, the fragrance is very strong, there is a sugar fragrance, barbecue-like meat fragrance,