使用 python Popen 或 os.system 运行多个 adb 命令
ADB 的一个问题是您需要多个命令才能完成任务。 例如:
adb shell
su
cp /data/local/x /data/local/y
exit
adb pull /data/local/y
可以使用 python popen 和 os-system 来完成此操作吗?尝试下面的例子没有成功..
print 'Starting emulator...'
subprocess.Popen(['emulator', '-avd', 'testavd'])
os.system('adb wait-for-device')
os.system('Perform whatever adb commands you need')
有什么指示吗?
One problem with ADB is that you need multiple commands to get things done.
For example:
adb shell
su
cp /data/local/x /data/local/y
exit
adb pull /data/local/y
Can this be done using python popen and os-system? Tried the example below without success..
print 'Starting emulator...'
subprocess.Popen(['emulator', '-avd', 'testavd'])
os.system('adb wait-for-device')
os.system('Perform whatever adb commands you need')
Any pointers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以简单地执行以下操作:
或者,如果您想运行多个命令(仅限 Linux 和 OSX):
You can simply do:
or, if you want to run more than one command (only Linux & OSX):