Digital learnings and other such nonsense…
SMS text messaging simulation on android
As part of an application I’m currently developing, I need to be able to interogate incoming SMS messages. Since I’ll be developing against the emulator initially I need a way of sending in SMS messages to the emulator. Fortunately, we can use adb to poke in SMS messages at will, as detailed below.
Ultimately, you’ll need to telnet into your emulator, and you’ll need two things:
- The port the emulator runs on. To find this out, open up a command window and type :
adb devices
You should see something like this :
C:\development\projects\AndroidSam\trunk_androidsam>adb devices
List of devices attached
emulator-5554 device
List of devices attached
emulator-5554 device
So my emulator is running on the default port of 5554.
- Secondly, if you’re a Windows 7 / Vista user, you probably won’t have telnet enabled by default, so switch that on by going into Control Panel > Programs > Programs and Features > Turn Windows features on or off.
Now, lets actually send in an SMS. From the command window, type :
telnet localhost 5554
sms send 07841123123 Hello this is a sample message
OK
Then have a look at your emulator, you should see the SMS come through.
Stick around, I’ll post up some more SMS related tips in the coming weeks!



Hi,
is there a way to simulate incoming sms on a real device?
Thanks,
Alex
You can use telnet to send an sms to the inbox, however this doesn’t popup any notifications like a real text would. I’m not aware of a way of mocking a text on a real device (I haven’t looked much to be honest), but if you find anything please let me know :)
Hi,
thanks for your answer. How can I use telnet? Telnet to an emulator works perfectly, but I get always “telnet: Unable to connect to remote host: Connection refused” when using a real device.