Python 在 Mac 使用 Python subprocess.check_output 报错,请各位帮忙看看是什么问题?

hardy · 2019年01月24日 · 1599 次阅读

已经使用 Python 把 adb 命令封装好,单独运行没有问题,把它导入到其他文件中运行就报错了,具体如下:

adb 命令:adb shell uiautomator dump /mnt/sdcard/ui.xml
把上面的命令使用 Python 的 subprocess.check_output 封装完成函数 A,单独运行函数 A 正常,把函数 A 导入到其他模块中运行就报错:
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError:Command 'adb shell uiautomator dump /mnt/sdcard/ui.xml'
return non-zero exit status 137

追问:是不是这个命令不能使用 subprocess 执行?

暫無回覆。
需要 登录 後方可回應,如果你還沒有帳號按這裡 注册