Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
binder/android/os/ | 03-May-2024 | - | 89 | 14 | ||
tests/ | 03-May-2024 | - | 1,292 | 959 | ||
.clang-format | D | 03-May-2024 | 288 | 14 | 12 | |
Android.bp | D | 03-May-2024 | 3.1 KiB | 131 | 124 | |
Android.mk | D | 03-May-2024 | 593 | 23 | 12 | |
AndroidTest.xml | D | 03-May-2024 | 1.2 KiB | 27 | 12 | |
DumpstateInternal.cpp | D | 03-May-2024 | 6 KiB | 184 | 145 | |
DumpstateInternal.h | D | 03-May-2024 | 1.8 KiB | 62 | 30 | |
DumpstateService.cpp | D | 03-May-2024 | 3.7 KiB | 107 | 76 | |
DumpstateService.h | D | 03-May-2024 | 1.4 KiB | 52 | 25 | |
DumpstateUtil.cpp | D | 03-May-2024 | 11.9 KiB | 385 | 297 | |
DumpstateUtil.h | D | 03-May-2024 | 5.7 KiB | 187 | 71 | |
README.md | D | 03-May-2024 | 2.1 KiB | 104 | 68 | |
bugreport-format.md | D | 03-May-2024 | 4.1 KiB | 94 | 72 | |
dumpstate.cpp | D | 03-May-2024 | 73.7 KiB | 2,003 | 1,512 | |
dumpstate.h | D | 03-May-2024 | 13.4 KiB | 432 | 145 | |
dumpstate.rc | D | 03-May-2024 | 624 | 20 | 17 | |
utils.cpp | D | 03-May-2024 | 43.1 KiB | 1,343 | 1,049 |
README.md
1# `dumpstate` development tips 2 3## To build `dumpstate` 4 5Do a full build first: 6 7``` 8m -j dumpstate 9``` 10 11Then incremental ones: 12 13``` 14mmm -j frameworks/native/cmds/dumpstate 15``` 16 17If you're working on device-specific code, you might need to build them as well. Example: 18 19``` 20mmm -j frameworks/native/cmds/dumpstate device/acme/secret_device/dumpstate/ hardware/interfaces/dumpstate 21``` 22 23## To build, deploy, and take a bugreport 24 25``` 26mmm -j frameworks/native/cmds/dumpstate && adb push ${OUT}/system/bin/dumpstate system/bin && adb shell am bug-report 27``` 28 29## To build, deploy, and run unit tests 30 31First create `/data/nativetest`: 32 33``` 34adb shell mkdir /data/nativetest 35``` 36 37Then run: 38 39``` 40mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest/dumpstate_test* /data/nativetest && adb shell /data/nativetest/dumpstate_test/dumpstate_test 41``` 42 43And to run just one test (for example, `DumpstateTest.RunCommandNoArgs`): 44 45``` 46mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest/dumpstate_test* /data/nativetest && adb shell /data/nativetest/dumpstate_test/dumpstate_test --gtest_filter=DumpstateTest.RunCommandNoArgs 47``` 48 49## To take quick bugreports 50 51``` 52adb shell setprop dumpstate.dry_run true 53``` 54 55## To change the `dumpstate` version 56 57``` 58adb shell setprop dumpstate.version VERSION_NAME 59``` 60 61Example: 62 63``` 64adb shell setprop dumpstate.version split-dumpsys && adb shell dumpstate -v 65``` 66 67 68Then to restore the default version: 69 70``` 71adb shell setprop dumpstate.version default 72``` 73 74## Code style and formatting 75 76Use the style defined at the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) 77and make sure to run the following command prior to `repo upload`: 78 79``` 80git clang-format --style=file HEAD~ 81``` 82 83## Useful Bash tricks 84 85``` 86export BR_DIR=/bugreports 87 88alias br='adb shell cmd activity bug-report' 89alias ls_bugs='adb shell ls -l ${BR_DIR}/' 90 91unzip_bug() { 92 adb pull ${BR_DIR}/$1 && emacs $1 && mv $1 /tmp 93} 94 95less_bug() { 96 adb pull ${BR_DIR}/$1 && less $1 && mv $1 /tmp 97} 98 99rm_bugs() { 100 if [ -z "${BR_DIR}" ] ; then echo "Variable BR_DIR not set"; else adb shell rm -rf ${BR_DIR}/*; fi 101} 102 103``` 104