TELNET is a A terminal emulation program for TCP/IP networks such as the Internet. Telnet provided access to a command-line interface on a remote host. Most network equipment and operating systems with a TCP/IP stack support a Telnet service for remote configuration. The Telnet program runs on your computer and connects your PC to a server on the network. You can then entercommands through the Telnet program and they will be executed as if you were entering them directly on the server console. This enables you to control the server and communicate with other servers on the network.
So we can use telnet to connect to the Android Virtual Device (AVD) or the android emulator and perform certain operations that deal with certain environmental values and settings. Here the AVD is running as a localhost. So before connecting, note down the port at which it is running. Generally the top of the AVD gives the port number. Eg. my AVD runs on 5554.
to connect to the in the terminal use the command:
$ telnet localhost 5554
if connected successfully an OK message should be displayed.he various operations that can be performed are-
1. To toggle between the speed of the Internet connection use:
network speed edge
the result is that the network connection is now slow and can be seen on the avd with e marked with the data pack symbol.
To get the full connection speed type
network speed full
2.Sending SMS message . you can send to the avd messages :
the syntax is
“sms send <sender’s phone number> <message>”
Eg. sms send 1234000000 this is good.
This will cause a message to appear in the avd from the phone 123400000 with the message “this is good”.
3.The charging indicator can be changed to show the amount of charging done including o for full. All the input taken is in terms of percentages.
Eg. power 50 will make the charging to 50%
power 73 will make the charging to 73%
4. the help command will provide a list of all the operations that can be performed along with their option if any. The others include operations like fixing the location(GPS COORDINATE) of the AVD by using the geo fix command, or kill command to terminate the instance of the emulator
Here is a summary of the commands and its use:
help|h|? print a list of commands
event simulate hardware events
geo Geo-location commands
gsm GSM related commands
kill kill the emulator instance
network manage network settings
power power related commands
quit|exit quit control session
redir manage port redirections
sms SMS related commands
avd manager virtual device state
window manage emulator window
SOURCE : Webopedia , coursera