1page.title=Dumpsys System Diagnostics 2@jd:body 3 4<!-- 5 Copyright 2015 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18--> 19<div id="qv-wrapper"> 20 <div id="qv"> 21 <h2>In this document</h2> 22 <ol id="auto-toc"> 23 </ol> 24 </div> 25</div> 26 27<p>The <code>dumpsys</code> tool runs on the device and provides information about the status 28of system services. </p> 29 30<h2 id=how_to_use_dumpsys>How to use dumpsys</h2> 31 32<p>If you run <code>adb shell dumpsys</code>, you’ll get diagnostic output for 33all system services, which is usually more than you want. For more manageable 34output, specify the service you would like to examine. </p> 35 36<p>For example, the following command:</p> 37 38<pre> 39$ adb shell dumpsys input 40</pre> 41 42<p>provides system data for input components such as touchscreens or built-in 43keyboards.</p> 44 45<h2 id=list_of_system_services>List of system services</h2> 46 47 48<p>For a complete list of system services that you can use with dumpsys, try the 49following command:</p> 50 51<pre class="no-pretty-print"> 52$ adb shell dumpsys -l 53Currently running services: 54 DockObserver 55 SurfaceFlinger 56 accessibility 57 account 58 activity 59 alarm 60 android.security.keystore 61 appops 62 appwidget 63 assetatlas 64 audio 65 backup 66 battery 67 batteryproperties 68 batterystats 69 bluetooth_manager 70 clipboard 71 commontime_management 72 connectivity 73 consumer_ir 74 content 75 country_detector 76 cpuinfo 77 dbinfo 78... 79</pre> 80 81<h2 id=dumpsys_command-line_options>Dumpsys command-line options</h2> 82 83<p>Command-line options are different for different services. Here are a few 84common ones:</p> 85 86<ul> 87 <li> For many services, you can append <code>-h</code> to see the help 88text. 89 <li> For some services, you can append <code>-c</code> to view the data in 90a machine-friendly format. </ul> 91 92<h2 id=understanding_diagnostic_output>Understanding diagnostic output</h2> 93 94<p>For details on some of the most commonly used dumpsys services, see the 95following articles:</p> 96 97<ul> 98 <li> <a 99 href="{@docRoot}devices/input/diagnostics.html">Viewing Input Diagnostics (dumpsys input)</a> 100 <li> <a href="{@docRoot}devices/tech/ram/procstats.html">Viewing RAM Usage Data (dumpsys procstats)</a> 101 <li> <a href="{@docRoot}devices/tech/netstats.html">Viewing Network Data (dumpsys netstats)</a> 102 <li> <a href="{@docRoot}devices/tech/power/batterystats.html">Viewing Battery Usage Data (dumpsys batterystats)</a> 103</ul> 104 105