summaryrefslogtreecommitdiffstats
path: root/adb/bugreport.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Don't preserve file attributes when pulling bugreport file..."Treehugger Robot2017-08-221-1/+1
|\
| * Don't preserve file attributes when pulling bugreport file...Felipe Leme2017-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | ...otherwise it could have weird dates when the device clock is wrong. Test: m -j32 adb && ./out/host/linux-x86/bin/adb bugreport test.zip && ls -l test.zip Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test Fixes: 63927360 Change-Id: I3f87277f1acb97212a87b89639e42b6d7d300faa
* | adb: allow selection of a specific transport.Josh Gao2017-08-211-7/+6
|/ | | | | | | | | | | | Extend device selection to allow selecting a specific transport via monotonically increasing identifier (visible in devices -l). This is useful when using multiple devices (like hikey960...) that have identical bogus serial numbers like 0123456789ABCDEF. Bug: http://b/37043226 Test: adb -t {1, 2, 9999999} {get-serialno, shell, features} Change-Id: I55e5dc5a406a4eeee0012e39b52e8cd232e608a6
* Always print the initial bugreport progress message.Felipe Leme2017-05-231-1/+1
| | | | | | | | | | | Otherwise, it might take seconds to display the initial percentage, and the user might thing something is wrong and CTRL-C the process. Fixes: 62003852 Test: added BugreportTest.OkProgressZeroPercentIsNotIgnored Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.* Change-Id: I8e7dbb28666c825c1408d5d204f813064fc3048f
* Merge "Don't display bugreport progress when it recedes, for real..."Treehugger Robot2017-05-031-8/+8
|\
| * Don't display bugreport progress when it recedes, for real...Felipe Leme2017-05-021-8/+8
| | | | | | | | | | | | | | | | | | | | | | The previous fix was taking account just the progress reported by dumpstate, not progress/percentage. As such, it was not detecting the cases where the percentage decreased but the progress didn't. Bug: 37878670 Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.* Change-Id: I5830028f3191a9b17f63aeed5c049b29fa7d1179
* | Fix various adb error reporting bugs.Elliott Hughes2017-04-181-2/+2
|/ | | | | | | | | | | | | | | | `adb install` was writing success to stderr rather than stdout. Server mismatch messages were going to stdout rather than stderr. Error messages should consistently start with a lower case letter. Also improve consistency of syntax error reporting. Bug: https://issuetracker.google.com/37128706 (adb install success to stdout) Bug: https://issuetracker.google.com/37140458 (server mismatch on stderr) Bug: http://b/32413861 (consistency) Test: ran tests Change-Id: I0d6cb0c7482bec03483dacefd996644b7a28d273
* Don't display bugreport progress when it recedes.Felipe Leme2017-03-201-1/+12
| | | | | | | | | | | Also fixed InvalidNumberArgs that broke when usage() was moved out from bugreport.cpp. Fixes: 26354314 Bug: 28054087 Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.* Change-Id: I7be5ef7de0fb0d339dc80a2abc816e1c905deb22
* Move adb_dirname and adb_basename to libbaseColin Cross2017-02-271-2/+3
| | | | | | | | | | | adb already provides an implementation of dirname and basename that take and produce std::strings, move it into libbase so it can be used in the implementation of GetExecutableDirectory. Test: out/host/linux-x86/nativetest64/adb_test/adb_test Test: out/host/linux-x86/nativetest64/libbase_test/libbase_test Test: adb shell /data/nativetest64/libbase_test/libbase_test64 Change-Id: Ideb1627607b14562121316d4ed27fa6fb0930684
* Don't print 168^W143 lines of help when someone makes a typo.Elliott Hughes2017-02-061-4/+1
| | | | | | | | | | Print actual usage messages in most cases. Add --help and --version. Bug: http://b/28054087 Test: manual Change-Id: I39c1cb7a84f52e0c35d24f140ec55c3a181283fb
* Merge "Make "adb bugreport"'s .zip check case-insensitive."Elliott Hughes2016-10-261-2/+1
|\ | | | | | | | | | | am: da6fe65000 Change-Id: I34d95b38bec230729b3707c698b347c9a5908831
| * Make "adb bugreport"'s .zip check case-insensitive.Elliott Hughes2016-10-251-2/+1
| | | | | | | | | | | | Bug: TODO Test: manual Change-Id: I0ece7d8dcb708e3755477f7df5ff03807fd227f2
| * Move off std::sto* function which abort on failure.Elliott Hughes2016-10-131-3/+6
| | | | | | | | | | | | Bug: http://b/31403370 Test: builds, boots, libbase tests pass Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
| * DO NOT MERGE: Split 'generating' and 'pulling' in 2 messages.Felipe Leme2016-08-301-5/+5
| | | | | | | | | | | | | | BUG: 30799929 Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a (cherry picked from commit 9c0be90528baee54182334048af467e3dde74d72) (cherry picked from commit 321c21e2df13cb375a9c96dbdbb7c849734a9293)
| * DO NOT MERGE: Ignore bugreportz output when it's not supported.Felipe Leme2016-08-301-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | On devices running M or below, calling 'bugreportz -v' writes '/system/bin/sh: bugreportz: not found' in the stdout output, which must be redirected to stderr so it's not shown in the flat-file bugreport, above the bugreport header. BUG: 30451114 Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a (cherry picked from commit 9a882a3ef38c487eaa26dee845bb738997d5023d) (cherry picked from commit b0022b036e10bbad8536286a32228a8f90c80068)
| * DO NOT MERGE: Deprecated 'adb bugreport' with flat files.Felipe Leme2016-08-301-26/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting on Android N, zipped bugreports contain more information than flat-file, text bugreports. On N, calls to 'adb bugreport' would still generate a flat-file bugreport, but with a warning. With this change, 'adb bugreport' will generate a zipped bugreport in the current directory, using the bugreport name provided by the device. Similarly, calling 'adb bugreport dir' will generate a bugreport with a device-provided name, but in such directory. BUG: 30451114 BUG: 29448020 Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90 (cherry picked from commit 307951e124afc0ab385dc679a57562d339049e2b) (cherry picked from commit f8d9e4eb0062c0122fc87ced5c6c6b6a6e3f4521)
| * DO NOT MERGE: Minor improvements on bugreport generation.Felipe Leme2016-08-301-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Skipped artificial 100/100 message, since pulling will take care of the final 100% progress. - Consolidated unsupported lines in just one message. - Let user know the bugreport can still be recovered when it could not be copied to the destination directory. BUG: 30451114 Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab (cherry picked from commit 80a65d03c997637c9fc8a41d878aa3f25ef9e668) (cherry picked from commit 5f6eacaeda3aad9b60a6cf4a139bd1e544c7aecb)
| * DO NOT MERGE: Removed extra 'pulling file' message.Felipe Leme2016-08-301-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Taking a zip bugreport has 2 phases: generating the bugreport and pulling the file. Initially adb was printing 2 messages, but since the latter is almost instantaneously, it could be confusing to have 2 lines... Fixes: 30451250 Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f (cherry picked from commit f7c38b4c03d75c9cb27610acab96f4e7f4169de8) (cherry picked from commit 33ae849fefa1605a472ac82c2c4ee8eb0af23463)
| * DO NOT MERGE: Show bugreport progress.Felipe Leme2016-08-301-27/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adb calls bugreportz to generate a bugreport; initially, bugreportz would only report the final status of the operation (OK or FAIL), but now it sends intermediate PROGRESS lines reporting its progress (in the form of current/max). Similarly, the initial implementation of 'adb bugreport <zip_file>' would print an initial 'please wait' message and wait for the full stdout before parsing the result, but now it uses a new callback class to handle the stdout as it is generated by bugreportz. BUG: 28609499 Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1 (cherry picked from commit cd42d658b2d08ace81b5ae3b108acbaca1a1d439) (cherry picked from commit 97b73a0daf74081a6324bb41cc34d9f0598cfe29)
| * DO NOT MERGE: Refactored functions that copy sdout and stderr to strings to ↵Felipe Leme2016-08-301-28/+52
| | | | | | | | | | | | | | | | | | | | use a callback. BUG: 28609499 Change-Id: I04aea346e18678ea00797f7f659480edba4436c2 (cherry picked from commit 07ac8554b477dc81579a5e63a2fbabc740fa8a92) (cherry picked from commit d18854218ec1e9fa2659f6c8be1ca17adefe68fb)
| * DO NOT MERGE: Split bugreport() into its own file and added unit tests.Felipe Leme2016-08-301-0/+80
| | | | | | | | | | | | | | | bugreport() will be soon refactored to track progress, which will require more comprehensive unit tests. As such, it's better to move it to its own files, which in turn also requires moving send_shell_command() and usage() to commandline.h. Fixes: 30100363 Bug: 30268737 Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0 (cherry picked from commit 78e0963e4bce9cc9f0bbf0b686004ba15b1e3929) (cherry picked from commit 218e1ff75998052c7bb30b483c15e75a853283a8)
* Split 'generating' and 'pulling' in 2 messages.Felipe Leme2016-08-171-5/+5
| | | | | | BUG: 30799929 Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a (cherry picked from commit 9c0be90528baee54182334048af467e3dde74d72)
* Ignore bugreportz output when it's not supported.Felipe Leme2016-08-171-8/+18
| | | | | | | | | | | | On devices running M or below, calling 'bugreportz -v' writes '/system/bin/sh: bugreportz: not found' in the stdout output, which must be redirected to stderr so it's not shown in the flat-file bugreport, above the bugreport header. BUG: 30451114 Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a (cherry picked from commit 9a882a3ef38c487eaa26dee845bb738997d5023d)
* Deprecated 'adb bugreport' with flat files.Felipe Leme2016-08-171-26/+96
| | | | | | | | | | | | | | | | | Starting on Android N, zipped bugreports contain more information than flat-file, text bugreports. On N, calls to 'adb bugreport' would still generate a flat-file bugreport, but with a warning. With this change, 'adb bugreport' will generate a zipped bugreport in the current directory, using the bugreport name provided by the device. Similarly, calling 'adb bugreport dir' will generate a bugreport with a device-provided name, but in such directory. BUG: 30451114 BUG: 29448020 Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90 (cherry picked from commit 307951e124afc0ab385dc679a57562d339049e2b)
* Minor improvements on bugreport generation.Felipe Leme2016-08-171-29/+46
| | | | | | | | | | | | | - Skipped artificial 100/100 message, since pulling will take care of the final 100% progress. - Consolidated unsupported lines in just one message. - Let user know the bugreport can still be recovered when it could not be copied to the destination directory. BUG: 30451114 Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab (cherry picked from commit 80a65d03c997637c9fc8a41d878aa3f25ef9e668)
* Removed extra 'pulling file' message.Felipe Leme2016-08-171-11/+13
| | | | | | | | | | | | Taking a zip bugreport has 2 phases: generating the bugreport and pulling the file. Initially adb was printing 2 messages, but since the latter is almost instantaneously, it could be confusing to have 2 lines... Fixes: 30451250 Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f (cherry picked from commit f7c38b4c03d75c9cb27610acab96f4e7f4169de8)
* Show bugreport progress.Felipe Leme2016-08-171-27/+102
| | | | | | | | | | | | | | | | | adb calls bugreportz to generate a bugreport; initially, bugreportz would only report the final status of the operation (OK or FAIL), but now it sends intermediate PROGRESS lines reporting its progress (in the form of current/max). Similarly, the initial implementation of 'adb bugreport <zip_file>' would print an initial 'please wait' message and wait for the full stdout before parsing the result, but now it uses a new callback class to handle the stdout as it is generated by bugreportz. BUG: 28609499 Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1 (cherry picked from commit cd42d658b2d08ace81b5ae3b108acbaca1a1d439)
* Refactored functions that copy sdout and stderr to strings to use a callback.Felipe Leme2016-08-171-28/+52
| | | | | | | BUG: 28609499 Change-Id: I04aea346e18678ea00797f7f659480edba4436c2 (cherry picked from commit 07ac8554b477dc81579a5e63a2fbabc740fa8a92)
* Split bugreport() into its own file and added unit tests.Felipe Leme2016-08-171-0/+80
bugreport() will be soon refactored to track progress, which will require more comprehensive unit tests. As such, it's better to move it to its own files, which in turn also requires moving send_shell_command() and usage() to commandline.h. Fixes: 30100363 Bug: 30268737 Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0 (cherry picked from commit 78e0963e4bce9cc9f0bbf0b686004ba15b1e3929)