4

I want to send test SMS messages from my PC via adb, to the phone. Is this possible? I've seen scripts to automate sending SMS from the phone, but I want to simulate SMS messages to the phone. I was able to do this via the emulator by telneting to it. Is there something I can do with a real phone (Galaxy Nexus). I do'nt have the development phone hooked up to phone service; I want this to be directly from the comptuer to the phone.

Tanmay Mandal
  • 39,873
  • 12
  • 51
  • 48
Stealth Rabbi
  • 10,156
  • 22
  • 100
  • 176

2 Answers2

2

You could develop a small application that receives an Intent and which is capable of sending an SMS accordingly to the received data.

You need to declare a custom <intent-filer> in your AndroidManifest.xml and bind a BroadcastReceiver on that Intent. So you will be advertised everytime an Application issues this Intent.

On the other side, use the command line to send intents to your VMs using :

adb shell am start -a broadcast com.messenger.sms.send -e message my_message

In the BroadcastReceiver, the extra data will be accessible through a call to :

intent.getExtras().getString("message");

You can also find here more thorough examples on what you can do using am.

Halim Qarroum
  • 13,985
  • 4
  • 46
  • 71
1

Do you have another cell phone with actual service?

If only a rough simulation is what you're looking for, I'd suggest you set up a Google Voice account to receive texts from a Google Voice number via wifi, or just use something like MightyText to synchronize the sms messages/notifications from your activated phone with your deactivated development phone (over wifi).

I assume that MightyText will probably be the easiest and quickest to set up between the two.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49