?
Solved

Redirect [ADB.exe] Output to a File

Posted on 2014-10-14
2
Medium Priority
?
1,272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
clockwatcher earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
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…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

771 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