1

I am sending an SMS using adb. The following command ./adb shell am start -a android.intent.action.SENDTO -d sms:12345 --es sms_body "the body" --ez exit_on_sent true , while typed in and executed in bash, does it's job but my python script seems to call ./adb only:

    ADB = './adb'
    def callSMScmd(msg, num):
        adbArgs = ('shell am start -a '
                +'android.intent.action.SENDTO -d sms:'+str(num)+' --es'
                +'sms_body "'+msg+'" --ez exit_on_sent true')
        call([ADB, adbArgs])

The proper return would be Starting: Intent { act=android.intent.action.SENDTO dat=sms:12345 (has extras) } Unfortunately this script lists the adb version and all available options; no warnings, no errors. Thanks in advance for any help

1 Answer 1

2

Make shell a separate parameter:

call(['adb', 'shell', 'am start -a android.intent.action.SENDTO ...'])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.