我希望記錄應用程序(eg.com.clov4r.android.nil)我操作應用程序時的CPU佔用率(例如,執行猴子測試),並完成記錄時,我eixt應用程序(例如,猴子測試)。如何用python實現它?蟒蛇如何保持一個線程執行,直到其他線程完成
有些代碼:
packagename = 'com.clov4r.android.nil'
cmd1 = 'adb shell top -d 5 | grep com.clov4r.android.nil'
cmd2 = 'adb shell monkey -v -p com.clov4r.android.nil --throttle 500 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --monitor-native-crashes -s 2345 100'
t1 = threading.Thread(target=subprocess.call(cmd1, stdout=open(r'123.txt', 'w')))
t2 = threading.Thread(target=subprocess.call(cmd2))
你能告訴我們你需要修復的代碼嗎? – 2013-02-20 06:00:10
以上是我的代碼,感謝您的關注 – Fern 2013-02-20 06:52:49