Solved

Redirect [ADB.exe] Output to a File

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 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

16 Experts available now in Live!

Get 1:1 Help Now