Tuesday, December 14, 2010

Simulate an Incoming sms on Android Emulator

You can simulate an incoming sms in an Android Virtual Device Emulator in two ways. 
  1. Command Prompt (Windows)
  2. Eclipse
If you don't have Eclipse configured, then you can try to simulate a sms to the Emulator from the command prompt. I prefer using Eclipse because it is easy to use.

1. Command Prompt
  • Open Command Prompt 
  • Type telnet
  • Then type o localhost 5554
            Here, an Emulator running locally in the port 5554 is connected. If the Emulator is using another port, then change 5554 correspondingly. Otherwise the connection fails.
  • Finally type sms send 123456 Hello
             Here 123456 is the phone number of the sender. It is in the format sms send <sender> <message>

2. Eclipse
  • Go to Debug mode when the Emulator is running ( Debug button is available at the top right corner of the Eclipse Window )
  • Go to Window -> Show View -> Other -> Android -> Emulator Control

Emulator Control
  • Now type the number in the Incoming number field, select SMS radio button and click on Send button to simulate the sms.

No comments:

Post a Comment