I try to execute adb pull via a groovy file to download files automatically from the device.
private void getFile(String fileName) {
def process = new ProcessBuilder().inheritIO()
.command(adbExec, "pull", "/sdcard/some.mp4").start();
process.waitFor();
}
After the process is finished, unfortunately the file (mp4 from screenrecord) seems to be corrupt. If i "pull it manually" everything is fine. Any ideas?
Cheers
Solved: After cancelling the screenrecord (via script) it needs some time to save it correctly. Screenrecord -> finished -> sleep -> pull -> works