Read Catalogue
- I. Overview
- Ii. Steps of implementation
Back to top one, overview
The Android system sets the PC IP to 10.0.2.2 For communication, and the PC does not specify an IP for the Android emulator system, so the PC does not have direct access to the Android emulator via IP, to realize the phase between PC and Android simulator. The use of port redirection (redir) is necessary for mutual communication.
Back to top Ii. implementation steps
1. Install Telnet
What is Telnet?
The Telnet protocol is a member of the TCP/IP protocol family and is the standard protocol and primary way for Internet remote Login services, providing users with the ability to perform remote host work on the local computer.
We can test the port number on the TCP side of the peer through the Telnet destination IP port number, which is not enabled. In addition, the default port number for the Telnet service destination is 23.
2. Running the simulator
3. Open the Windows command line and execute
The port number is the port number of the emulator, which is located in the title bar of the Android emulator window. After execution, enter Android console.
3. Execute commands under Android console
Redir Add tcp:5000:6000
Then execute the redir list to view the execution results:
This maps the 5000 port number on the PC side to the 6000 port of the Android emulator, and if the PC5000 port receives the data, it goes to port 6000 of the emulator.
4. Delete Port mappings
Use the command redir del to remove port mappings
Http://www.cnblogs.com/xujian2014/p/4935144.html
Port mapping for Android Simulator to PC (RPM)