我正在嘗試在Ubuntu上使用python和monkeyrunner自動化完整的CTS設(shè)置和執(zhí)行,并且大部分進展順利。作為最后一步,我嘗試執(zhí)行以下python命令以在特定設(shè)備上啟動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_r4No commands for non-interactive mode; exiting.06-17 17:32:32 I/: Detected new device R32CB054TSZSaved log to /tmp/tradefed_global_log_9173619073367947049.txt06-17 17:32:32 I/CommandScheduler: All doneCTS測試不會執(zhí)行。是否有我忘記的命令,或者使用Python無法做到?
2 回答

慕尼黑5688855
TA貢獻1848條經(jīng)驗 獲得超2個贊
cts_tradefed_script = "./android-cts/tools/cts-tradefed"
process = subprocess.Popen([cts_tradefed_script + " " + serialno], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
腳本是沒有必要的。只需輸入所有內(nèi)容作為串聯(lián)字符串即可。
添加回答
舉報
0/150
提交
取消