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.
You can send SMS by running a Python script in Linux Command-line. I have included here the python code for the script. But for this you need the SMS gateway of your carrier.
In fact, this can be done but requires adb to be installed (Part of the android SDK)
adb shell am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "SMS BODY GOES HERE" --ez exit_on_sent true adb shell input keyevent 22 adb shell input keyevent 66
Where CCXXXXXXXXXX is country-code followed by phone number. This may not work correctly on non-standard android installations, you will need to find the correct keyevent values to pass.
How about this?
service call isms 5 s16 "+??????????" i32 0 i32 0 s16 "SMS TEXT HERE"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With