我用亚行发短信。当输入并在bash中执行时,下面的命令./adb shell am start -a android.intent.action.SENDTO -d sms:12345 --es sms_body "the body" --ez exit_on_sent true完成了它的工作,但是我的python脚本似乎只调用了./adb:
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])正确的返回将是Starting: Intent { act=android.intent.action.SENDTO dat=sms:12345 (has extras) },不幸的是,该脚本列出了adb版本和所有可用选项;没有警告,也没有错误。提前感谢您的帮助
发布于 2013-07-30 15:39:53
使shell成为一个单独的参数:
call(['adb', 'shell', 'am start -a android.intent.action.SENDTO ...'])https://stackoverflow.com/questions/17942000
复制相似问题