创建文件 recorder.py
from com.android.monkeyrunner import MonkeyRunner as mr
from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder
device = mr.waitForConnection()
recorder.start(device)
1.把recorder.py放到sdk的tools目录
2.cd到tools目录
cd sdkPath\tools
3.执行命令
monkeyrunner.bat recorder.py