diff options
author | Elliott Hughes <enh@google.com> | 2016-06-15 14:45:34 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-06-15 15:09:47 -0700 |
commit | 14415142c99223a98a539ec296f6de3f5d51e59f (patch) | |
tree | d47c0309dbf6cf3fd6336004b1106eca757c4a04 /adb/commandline.cpp | |
parent | 4d346537208189d05f34a44212cfc02200bcd5a0 (diff) | |
download | core-14415142c99223a98a539ec296f6de3f5d51e59f.tar.gz core-14415142c99223a98a539ec296f6de3f5d51e59f.tar.bz2 core-14415142c99223a98a539ec296f6de3f5d51e59f.zip |
Better diagnostics from "adb sideload".
Well, slightly less bad diagnostics, anyway.
Change-Id: Idf5612f7dcb9bdbd7252163889e2612ba197426d
Diffstat (limited to 'adb/commandline.cpp')
-rw-r--r-- | adb/commandline.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/adb/commandline.cpp b/adb/commandline.cpp index b815fef50..0d6ecb86f 100644 --- a/adb/commandline.cpp +++ b/adb/commandline.cpp @@ -872,19 +872,18 @@ static int adb_download_buffer(const char *service, const char *fn, const void* * we hang up. */ static int adb_sideload_host(const char* fn) { - printf("loading: '%s'", fn); - fflush(stdout); + fprintf(stderr, "loading: '%s'...\n", fn); std::string content; if (!android::base::ReadFileToString(fn, &content)) { - printf("\n"); - fprintf(stderr, "* cannot read '%s' *\n", fn); + fprintf(stderr, "failed: %s\n", strerror(errno)); return -1; } const uint8_t* data = reinterpret_cast<const uint8_t*>(content.data()); unsigned sz = content.size(); + fprintf(stderr, "connecting...\n"); std::string service = android::base::StringPrintf("sideload-host:%d:%d", sz, SIDELOAD_HOST_BLOCK_SIZE); std::string error; @@ -892,7 +891,7 @@ static int adb_sideload_host(const char* fn) { if (fd < 0) { // Try falling back to the older sideload method. Maybe this // is an older device that doesn't support sideload-host. - printf("\n"); + fprintf(stderr, "falling back to older sideload method...\n"); return adb_download_buffer("sideload", fn, data, sz, true); } |