Solved

Redirect [ADB.exe] Output to a File

Posted on 2014-10-14
2
992 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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 …
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now