views:

69

answers:

2

I would like to be able to send an actual SMS message from a shell using just the command line and not relying on any apk to do so. I am interested in sending this message between phones, not from the emulator to the phone. For example, by running the command:

service call phone 2 s16 "1234567890"

I can place a call from phone to phone using the command line. The 'service list' command shows an isms service, which I can't seem to provide the correct arguments for. I would assume that one of the args should be a PDU string but haven't had any luck so far.

A: 

I researched this a while ago - it can't be done.

If you find a way I'd be more than glad to learn it.

Peter Knego
+1  A: 

You can send any intent you want from the command line, so it's merely a matter of figuring out what intent can be used to send an sms, or if one doesn't exist, then writing an apk which provides such intent-to-sms capability and sending the intent to trigger that from the command line.

If you end up writing an apk to do that, think a little bit about permissions. Which user will the command line be running as - the adb shell user? any old ordinary app user? Your apk will presumably have sms permissions, but do you want to extent that to everything on the phone, or implement some security mechanism in your intent?

Chris Stratton