8
votes

I can't use the command telnet localhost 5554 to connect Android emulator. Always get this error:

Connecting To localhost...Could not open connection to the host, on port 5554: Connect failed

I even have all ports set to allow connections in both the inbound and outbound rules in Windows Firewall.

I am running Windows 7.

7
Try disabling the firewall completely. I once had a similar issue and allowing ports inbound/outbound and even disabling the firewall didn't help, only uninstalling the firewall solved the problem: stackoverflow.com/questions/4499803/…Android Eve
@Android Eve : Disabling the firewall doesn't help either.IT-Fan
Sorry all I need to launch the emulator before use telnet. My bad. Problem solved !IT-Fan
Told ya'! :-) Too bad comments need to be 15 characters...Szocske

7 Answers

6
votes

I've encountered this issue a few times, I'm not sure how the the emulator deals with addresses, but localhost just doesn't work for me.

Changing the connection command to telnet 127.0.0.1 5554 enabled me to connect, so if localhost doesn't work, try 127.0.0.1

2
votes

Try using the complete command inside telnet:

Microsoft Telnet> open localhost 5554

That should work, sometimes we forget to write the entire command

1
votes

Use the netstat tool to verify the application is listening on that port. I'm not familiar with netstat on windows, but it seems you'll need -a -n and optionally the -o options.

If you see the process listening, keep looking at the firewall. If you don't see one, figure out why it's not running.

1
votes

Firstly ... you should enable Telnet command in windows .

check this http://www.labnol.org/software/windows-telnet-command/18222/

then it will work :)

1
votes

first simply type telnet to your command prompt

Microsoft Telnet> open 127.0.0.1 5554

above line might show you following result

Android Console: Authentication required

Android Console: type 'auth ' to authenticate

Android Console: you can find your in C:\Users\YOURPCNAME.emulator_console_auth_token' OK

then go into your 'c' drive then user where you find .emulator_console_auth_token open that file and put you auth token like below

auth ################

then you find

Android Console: type 'help' for a list of commands

OK

it means you are connected now..

1
votes

If "telnet localhost 5554" doesnt work, try using port 5037. Also ensure that the Emulator is running.

0
votes

In cmd: you press cd D:\Android\sdk\platform-tools. It is path to platform-tools in your computer. After you can input telnet localhost 5554

redir add udp:9876:9876 or redir add tcp:5000:6000