ADB push/pull, on Linux, wanting to suppress progress messages

381 views
Skip to first unread message

John Dallman

unread,
Oct 3, 2018, 10:40:33 AM10/3/18
to andro...@googlegroups.com
I'm making quite a lot of use of "adb push" to move test data on to devices. This is done by shell scripts running on my Linux development host, whose output is redirected to plain-text log files. And those get quite a bit of output, thus: 

[  2%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 0%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 1%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%
[  3%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%
[  4%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%
[  4%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%
[  4%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%
[  4%] /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release/kid.out: 2%

kid.out is about 54MB, and thus takes several seconds to push. Is there a way to just get one line per file pushed, or something like that? 

I can't find anything in the adb built-in help, or the web page about it at https://developer.android.com/studio/command-line/adb#issuingcommands. I took a look at the source on github, but C++ is about my fifth language, and it will take me quite some time to figure out where the calls to LinePrinter are coming from. So I'm checking if there's a commonplace answer to this. 

Thanks,

John

Dan Albert

unread,
Oct 3, 2018, 11:51:06 AM10/3/18
to android-ndk
This is not related to the NDK. Could you file a bug at http://b.android.com so the right people see it?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqg%3DKNMNuGMFT101hMB0ty_G3x0iomp%3DmPAWOidDeLyrzWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

John Dallman

unread,
Oct 3, 2018, 12:07:51 PM10/3/18
to andro...@googlegroups.com
On Wed, Oct 3, 2018 at 4:51 PM 'Dan Albert' via android-ndk <andro...@googlegroups.com> wrote:
This is not related to the NDK. Could you file a bug at http://b.android.com so the right people see it?

Certainly, but while it's clearly a developer tools issue, it's not obvious which category of those it belongs in. Any suggestions? 
  • Android Studio
  • C++ 
  • Emulator or System Images
  • Gradle
  • Instant Run
  • Lint
  • NDK 
  • Profilers
  • AndroidX (Support Library)
  • Test Support Library
Thanks, John

Dan Albert

unread,
Oct 3, 2018, 1:53:27 PM10/3/18
to android-ndk
Huh, good point! I've sent a patch to fix that page, but for now, https://issuetracker.google.com/issues/new?component=192795

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.

John Dallman

unread,
Oct 4, 2018, 5:24:31 AM10/4/18
to andro...@googlegroups.com
On Wed, Oct 3, 2018 at 6:53 PM 'Dan Albert' via android-ndk <andro...@googlegroups.com> wrote:
Huh, good point! I've sent a patch to fix that page, but for now, https://issuetracker.google.com/issues/new?component=192795

Alex Cohn

unread,
Oct 4, 2018, 6:13:27 AM10/4/18
to android-ndk
I believe that 

adb push kid.out /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release >/dev/null

will do the trick.

BR,
Alex

John Dallman

unread,
Oct 4, 2018, 7:50:20 AM10/4/18
to andro...@googlegroups.com
On Thu, Oct 4, 2018 at 11:13 AM Alex Cohn <sasha...@gmail.com> wrote:
I believe that 
adb push kid.out /data/local/tmp/local_parasolid/lx86/lx86/v310_anda_test/system/release >/dev/null
will do the trick.
 
Well, yes, of course. That's basic UNIX i/o redirection. But that discards all the information. 

We need to know that the push succeeded, it just doesn't need to be at such great length. Yesterday I pushed two directory trees of test data: the first was 124,357 files, 11,122,852,629 bytes,  and the second 147,727 files, 52,160,722,070 bytes. The log file for those is 127MB, and while it does contain useful information, it's only a few lines of the file. 

I can get pretty close to a good report with 

adb push $src $destination | egrep -i 'skipp|error' | egrep -v '_error|empty directory'

That gets me the end-of-job reports and reasonable hope of getting any error messages, but there are files in the jobs whose names are "error" and I can't distinguish between an error on a file called "error" and the reporting of the file called "error". This is a case where controllable error reporting by adb will just work better. 

Thanks,

John

Alex Cohn

unread,
Oct 4, 2018, 11:12:17 AM10/4/18
to android-ndk
Have you tried to look at the exit code? 

adb push $src $destination > /dev/null && echo OK

John Dallman

unread,
Aug 7, 2019, 5:00:49 AM8/7/19
to andro...@googlegroups.com
And fixed last week. Thanks for the help, everyone. 
Reply all
Reply to author
Forward
0 new messages