现在能用自动化实现的,尽量使用自动化程序去操作,代替人工去操作,更有效率。
今天说下用python结合亚行命令去实现安卓手机端的通话压力测试。
#操作前先在设置里打开电源键可以结束通话按钮,否则会导致代码报的错 从进口睡眠时间 进口操作系统 def test_call (number1科学number3, number4, number5): #拨打电话 电话=操作系统。popen (adb壳是开始——android.intent.action.CALL - d电话:{}“.format (number1)) 睡眠(20) #挂断电话 挂起=操作系统。popen (adb shell输入keyevent 26) 睡眠(5) 电话=操作系统。popen (adb壳是开始——android.intent.action.CALL - d电话:{}“.format(科学)) 睡眠(5) #挂断电话 挂起=操作系统。popen (adb shell输入keyevent 26) 睡眠(5) 电话=操作系统。popen (adb壳是开始——android.intent.action.CALL - d电话:{}“.format (number3)) 睡眠(20) #挂断电话 挂起=操作系统。popen (adb shell输入keyevent 26) 睡眠(5) 电话=操作系统。popen (adb壳是开始——android.intent.action.CALL - d电话:{}“.format (number4)) 睡眠(20) #挂断电话 挂起=操作系统。popen (adb shell输入keyevent 26) 睡眠(5) 电话=操作系统。popen (adb壳是开始——android.intent.action.CALL - d电话:{}“.format (number5)) 睡眠(20) #挂断电话 挂起=操作系统。popen (adb shell输入keyevent 26) 睡眠(2) #你可以修改你要通话的号码如下: number1=10010 科学=10086 number3=10011 number4=12580 number5=114 #执行代码: test_call (number1科学number3、number4 number5) #截的图 截图=操作系统。popen (adb shell/系统/bin/screencap - p/sdcard/xie.png”) #将截图保存到电脑 SaveScreenShot=操作系统。popen (adb/sdcard/xie.png拉) >之前以上这篇python实现手机自动拨打电话的方法(通话压力测试)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
python实现手机自动拨打电话的方法(通话压力测试)