使用python自动化android CTS [英] automating android CTS with python
本文介绍了使用python自动化android CTS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用python& amp;自动执行完整的CTS设置和执行在Ubuntu上使用monkeyrunner,大多数情况进展顺利.作为最后一步,我尝试执行以下python命令以在特定设备上启动CTS:
I'm trying to automate the full CTS setup and execution with python & monkeyrunner on Ubuntu and most of it has gone very well. As the very final step, I try executing the following python command to start the CTS on a specific device:
cts_tradefed_script = "./android-cts/tools/cts-tradefed"
process = subprocess.Popen([cts_tradefed_script, "run", "cts", "-s", '"' + serialno + '"', "--plan", "CTS"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
等效于:
./android-cts/tools/cts-tradefed run cts -s "R32CB054TSZ" --plan CTS
在命令行中,我得到:
Android CTS 4.2_r4
No commands for non-interactive mode; exiting.
06-17 17:32:32 I/: Detected new device R32CB054TSZ
Saved log to /tmp/tradefed_global_log_9173619073367947049.txt
06-17 17:32:32 I/CommandScheduler: All done
CTS测试未执行.是否有我忘记的命令,或者使用Python无法做到?
The CTS tests don't execute. Is there a command I'm forgetting or is this not possible using Python?
推荐答案
cts_tradefed_script = "./android-cts/tools/cts-tradefed"
process = subprocess.Popen([cts_tradefed_script + " " + serialno], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
不需要脚本.只需输入所有内容作为串联字符串即可.
script was not necessary. Just enter everything as a concatenated String.
这篇关于使用python自动化android CTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文