gpt4 book ai didi

android - 使用 python 自动化 android CTS

转载 作者:太空宇宙 更新时间:2023-11-03 10:49:07 26 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 上使用 python 和 monkeyrunner 自动执行完整的 CTS 设置和执行,其中大部分进展顺利。作为最后一步,我尝试执行以下 python 命令以在特定设备上启动 CTS:

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 不可能做到这一点?

最佳答案

cts_tradefed_script = "./android-cts/tools/cts-tradefed"
process = subprocess.Popen([cts_tradefed_script + " " + serialno], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

编辑:脚本不是必需的。只需将所有内容作为串联字符串输入即可。

关于android - 使用 python 自动化 android CTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17159057/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com