I need to execute adb commands from DOS batch files, but I need to know if the push and pull commands were successful. Do these commands return an ERRORLEVEL, or some other environment variable to determine of the push or pull was successful?


According to the source code for ADB push and pull commands, they return 0 for success and 1 for failure. I have not tried this in batch files, so cannot comment on accuracy.

  • Thanks, that is useful. When you say they return these values, do you mean as error levels, or to standard output? Can I use this: adb -s mydevice pull file1 file1 > reseult.txt ? – user3516774 May 28 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.