I'm trying to capture adb push progress percentage from a node script. I have tried to listen to stdout and stderr but it seems adb is not sending the percentage update to any of these streams. I have seen other old answers in SO about adding a progressbar in terminal and have tried to adapt their methods to my needs, but it seems they are not working anymore.
This is how I'm trying to do it from node. I think a command line solution would be nice too because I could translated easily to node.
var spawn = window.require('child_process').spawn;
const ls = spawn('adb', ['push', '/Users/juanjoseduran/Downloads/app-debug.apk',"2>&1", '/sdcard']);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data.toString());
});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data.toString());
});
ls.on('exit', function (code) {
console.log('child process exited with code ' + code.toString());
});
The handlers only trigger when the transfer is finished.