Solved

Redirect [ADB.exe] Output to a File

Posted on 2014-10-14
2
1,050 Views
Last Modified: 2014-10-14
Does anyone know how to redirect the output of the Android ADB.exe command to a file?

The following command runs successfully, but the results are NOT outputted to the file as expected.

this successfully copies the backups folder from my Android device to the Joe folder on my computer...
  adb pull /sdcard/backups Joe > results.txt
...but when I examine the "result.txt" file after the command had run, it's empty!

I even tried to redirect to the Clipboard: adb pull /sdcard/backups Joe | clip to no avail.  The ADB command runs successfully, it creates the Joe folder and copies data to it, but Clipboard is empty.

All the "redirection operators" (>, >>, |) don't seem to work with the ADB command.  Any ideas?

Thank you.
0
Comment
Question by:jkaios
2 Comments
 
LVL 25

Accepted Solution

by:
clockwatcher earned 500 total points
ID: 40381276
I don't have adb on this machine to test but vaguely recall that it writes to stderr.  Have you tried redirecting stderr?

adb pull /sdcard/backups Joe 2> results.txt

Or redirecting stderr to stdout (if it happens to write to both):

adb pull /sdcard/backups Joe > results.txt 2>&1
1
 
LVL 12

Author Closing Comment

by:jkaios
ID: 40381416
Yup, it sure does!  Both methods work!  Thank you very much, clockwatcher.  I really can't think of a better place than EE ... :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question