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
Make shell a separate parameter:
call(['adb', 'shell', 'am start -a android.intent.action.SENDTO ...'])
answered Jul 30, 2013 at 15:39
Alex P.
32.1k17 gold badges125 silver badges178 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py