简体   繁体   English

如何使用 appium 调用 adb 命令?

[英]How to use appium to invoke adb command?

How to use appium to invoke adb command.如何使用 appium 调用 adb 命令。 This driver.executeScript ("mobile: shell", Cmd);这个driver.executeScript ("mobile: shell", Cmd); does not help, as this applies only to the internal Android system.没有帮助,因为这仅适用于内部 Android 系统。 I need to execute a command like adb backup -noshared com.android.chrome -f /home/profiles/chrome.adb我需要执行像adb backup -noshared com.android.chrome -f /home/profiles/chrome.adb这样的命令

But I need to do it without falls.但我需要做到不摔倒。 If i do this directly from Runtime.getRuntime().exec(Cmd) , appium will fall如果我直接从Runtime.getRuntime().exec(Cmd)执行此操作,appium 将下降

You likely want to look into the ProcessBuilder class .您可能想要查看ProcessBuilder 类

ProcessBuilder pb = new ProcessBuilder("adb", "backup", "-noshared", "com.android.chrome", "-f", "/home/profiles.chrome.adb");
Process pc = pb.start();
pc.waitFor();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM