Home | History | Annotate | only in /frameworks/native/cmds/dumpstate
Up to higher level directory
NameDateSize
.clang-format21-Aug-2018288
Android.bp21-Aug-20182.8K
Android.mk21-Aug-2018593
AndroidTest.xml21-Aug-20181.2K
binder/21-Aug-2018
bugreport-format.md21-Aug-20185.5K
dumpstate.cpp21-Aug-201889.7K
dumpstate.h21-Aug-201814.4K
dumpstate.rc21-Aug-2018624
DumpstateInternal.cpp21-Aug-20186.4K
DumpstateInternal.h21-Aug-20181.8K
DumpstateSectionReporter.cpp21-Aug-20181.5K
DumpstateSectionReporter.h21-Aug-20181.7K
DumpstateService.cpp21-Aug-20183.8K
DumpstateService.h21-Aug-20181.5K
DumpstateUtil.cpp21-Aug-201812.5K
DumpstateUtil.h21-Aug-20186.2K
main.cpp21-Aug-2018715
README.md21-Aug-20182.1K
tests/21-Aug-2018
utils.cpp21-Aug-201840.5K

README.md

      1 # `dumpstate` development tips
      2 
      3 ## To build `dumpstate`
      4 
      5 Do a full build first:
      6 
      7 ```
      8 m -j dumpstate
      9 ```
     10 
     11 Then incremental ones:
     12 
     13 ```
     14 mmm -j frameworks/native/cmds/dumpstate
     15 ```
     16 
     17 If you're working on device-specific code, you might need to build them as well. Example:
     18 
     19 ```
     20 mmm -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 ```
     26 mmm -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 
     31 First create `/data/nativetest`:
     32 
     33 ```
     34 adb shell mkdir /data/nativetest
     35 ```
     36 
     37 Then run:
     38 
     39 ```
     40 mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest/dumpstate_test* /data/nativetest && adb shell /data/nativetest/dumpstate_test/dumpstate_test
     41 ```
     42 
     43 And to run just one test (for example, `DumpstateTest.RunCommandNoArgs`):
     44 
     45 ```
     46 mmm -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 ```
     52 adb shell setprop dumpstate.dry_run true
     53 ```
     54 
     55 ## To change the `dumpstate` version
     56 
     57 ```
     58 adb shell setprop dumpstate.version VERSION_NAME
     59 ```
     60 
     61 Example:
     62 
     63 ```
     64 adb shell setprop dumpstate.version split-dumpsys && adb shell dumpstate -v
     65 ```
     66 
     67 
     68 Then to restore the default version:
     69 
     70 ```
     71 adb shell setprop dumpstate.version default
     72 ```
     73 
     74 ## Code style and formatting
     75 
     76 Use the style defined at the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)
     77 and make sure to run the following command prior to `repo upload`:
     78 
     79 ```
     80 git clang-format --style=file HEAD~
     81 ```
     82 
     83 ## Useful Bash tricks
     84 
     85 ```
     86 export BR_DIR=/bugreports
     87 
     88 alias br='adb shell cmd activity bug-report'
     89 alias ls_bugs='adb shell ls -l ${BR_DIR}/'
     90 
     91 unzip_bug() {
     92   adb pull ${BR_DIR}/$1 && emacs $1 && mv $1 /tmp
     93 }
     94 
     95 less_bug() {
     96   adb pull ${BR_DIR}/$1 && less $1 && mv $1 /tmp
     97 }
     98 
     99 rm_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