Solved

Redirect [ADB.exe] Output to a File

Posted on 2014-10-14
2
1,083 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

837 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