Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating SMS on Android Devices when developing

Tags:

android

Is there a way to send an SMS from te DDMS in Eclipse to my Android phone. The emulator control is disabled when I'm running my physical phone. I can only sent a SMS to the emulator.

like image 843
Mats Hofman Avatar asked Aug 21 '10 10:08

Mats Hofman


People also ask

Can Android emulator receive SMS?

1 1) Goto DDMS. 2) There, the left pane will consist of list of emulators active, select your emulator and then in the right pane you will get Emulator Control->Telephony action-> Incoming Number, Message. Type these and hit send. 3) In your emulator you will receive message.

How can I send SMS from emulator?

To install it, type the following command line in the Windows command prompt: pkgmgr /iu:”TelnetClient”. To send an SMS message to the emulator, use the following command: sms send +651234567 Hello my friend!

How we can send and receive SMS in Android application?

The user can tap the messaging icon in your app to send the message. In the messaging app launched by the intent, the user can tap to send the message, or change the message or the phone number before sending the message. After sending the message, the user can navigate back to your app using the Back button.


4 Answers

The newest way in 2019:

I hope in 2020 we'll be able to simulate SMS on real devices (if it's legal) enter image description here

like image 163
Andrii Kovalchuk Avatar answered Oct 08 '22 23:10

Andrii Kovalchuk


The following few steps should get you up into simulating an incoming sms in an Android Emulator.

Requirements:

1.Make sure that you have the telnet client in you PC whether it is Windows or Linux.Google around on how to install one if it is not already installed on your PC.

Steps To Emulating an incoming sms

(a) open you CMD prompt and Enter the command:

telnet

For now I am Demonstrating using Windows 7 ,so you will get

Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet>

(b)Assuming that your Emulator is already started.And while still on the CMD,type:

 o localhost 5554

this should open a connection to the emulator.

(c)To Emulate an incoming sms from a number say 0123456 type:

sms send 0123456 Your Message

You should be able to get the message in your android emulator inbox.Thats all Folks.

like image 41
Fred Ondieki Avatar answered Oct 08 '22 22:10

Fred Ondieki


Yeah it doesn't seem like it is possible. With the emulator you can do:

telnet localhost 5554
sms send +12345 A quick brown fox.

But if you try it with a real phone (well I tried a Galaxy S2) it just closes the connection. Of course it's always possible Samsung screwed up the code somewhere, but as common as that is, I think in this case the functionality is probably disabled for non-debug ROM builds.

like image 3
Timmmm Avatar answered Oct 08 '22 23:10

Timmmm


I am not sure about what versions of android or adb support this you can try

adb emu sms send [from] [message]

so for example

adb emu sms send "+1555....." "Your message goes here....."

Hope this helps.

PS: I think this only works with emulators.

like image 2
davejoem Avatar answered Oct 08 '22 22:10

davejoem