Kian
Kian

Reputation: 45

How to send a multi line sms with adb

After researching a while on how to send SMS's through ADB, I found a post that led me to this command:

adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+mynumberhere" s16 "null" s16 'Text Goes Here' s16 "null" s16 "null"

This command works just fine to send single line text, but I want to be able to format the SMS to be multiple lines, for example:

This is line 1 of the SMS
This is line 2 of the SMS
And this is line 3

I have tried to change the 'Text Goes Here' part to the following with no success:

"Test \n Test"
"Test /n Test"
"Test %n Test"
'Test \n Test'
'Test /n Test'
'Test %n Test'
"'Test\nTest'"
"'Test \n Test'"
"'Test/nTest'"
"'Test /n Test'"
"'Test'\n'Test'"

Absolutely none of them work and I can't find any method to solve this problem, what can I do?

Upvotes: 2

Views: 846

Answers (1)

Fahad Khan
Fahad Khan

Reputation: 24

try this

adb shell "NL=$'\n' ; am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "SMS BODY ${NL} GOES HERE" --ez exit_on_sent true"

Upvotes: 1

Related Questions