方式:adb log 来获取短信内容
import os
def GetCodeFromSms():
os.system("adb logcat -c")
cmd = ' adb logcat -d |findstr D/Mms/Txn'
while(1):
smscode = os.popen(cmd).read()
print smscode
if (smscode!=""):
smscode = smscode.split("验证码:")[1].split(",")[0]
break;
print "code is :",smscode