編輯:關於Android編程
adb shell dumpsys | grep DUMP或
adb shell dumpsys | grep "DUMP OF SERVICE"
就列出了當前手機支持的所有dumpsys參數:
DUMP OF SERVICE Exynos.HWCService: DUMP OF SERVICE SurfaceFlinger: DUMP OF SERVICE access_control: DUMP OF SERVICE accessibility: DUMP OF SERVICE account: DUMP OF SERVICE activity: DUMP OF SERVICE alarm: DUMP OF SERVICE android.security.keystore: DUMP OF SERVICE appops: DUMP OF SERVICE appwidget: DUMP OF SERVICE audio: DUMP OF SERVICE backup: DUMP OF SERVICE battery: DUMP OF SERVICE batterypropreg: DUMP OF SERVICE batterystats: DUMP OF SERVICE bluetooth_manager: DUMP OF SERVICE blurglassinfo: DUMP OF SERVICE clipboard: DUMP OF SERVICE com.meizu.nfc.NxpExt: DUMP OF SERVICE commontime_management: DUMP OF SERVICE connectivity: DUMP OF SERVICE consumer_ir: DUMP OF SERVICE content: DUMP OF SERVICE country_detector: DUMP OF SERVICE cpuinfo: DUMP OF SERVICE dbinfo: DUMP OF SERVICE deivce_states: DUMP OF SERVICE device_policy: DUMP OF SERVICE devicestoragemonitor: DUMP OF SERVICE diskstats: DUMP OF SERVICE display: DUMP OF SERVICE dreams: DUMP OF SERVICE drm.drmManager: DUMP OF SERVICE dropbox: DUMP OF SERVICE entropy: DUMP OF SERVICE gesture_manager: DUMP OF SERVICE gfxinfo: DUMP OF SERVICE hardware: DUMP OF SERVICE input: DUMP OF SERVICE input_method: DUMP OF SERVICE iphonesubinfo: DUMP OF SERVICE isms: DUMP OF SERVICE location: DUMP OF SERVICE lock_settings: DUMP OF SERVICE media.audio_flinger: DUMP OF SERVICE media.audio_policy: DUMP OF SERVICE media.camera: DUMP OF SERVICE media.player: DUMP OF SERVICE media_router: DUMP OF SERVICE meizu.camera: DUMP OF SERVICE meminfo: DUMP OF SERVICE mount: DUMP OF SERVICE netpolicy: DUMP OF SERVICE netstats: DUMP OF SERVICE network_management: DUMP OF SERVICE nfc: DUMP OF SERVICE notification: DUMP OF SERVICE package: DUMP OF SERVICE permission: DUMP OF SERVICE phone: DUMP OF SERVICE phone_ext: DUMP OF SERVICE power: DUMP OF SERVICE pppoe: DUMP OF SERVICE print: DUMP OF SERVICE procstats: DUMP OF SERVICE samba_client: DUMP OF SERVICE samba_server: DUMP OF SERVICE samplingprofiler: DUMP OF SERVICE scheduling_policy: DUMP OF SERVICE search: DUMP OF SERVICE secloader: DUMP OF SERVICE secloader2: DUMP OF SERVICE secsystemserver: DUMP OF SERVICE sensorservice: DUMP OF SERVICE serial: DUMP OF SERVICE servicediscovery: DUMP OF SERVICE simphonebook: DUMP OF SERVICE sip: DUMP OF SERVICE statusbar: DUMP OF SERVICE telephony.registry: DUMP OF SERVICE textservices: DUMP OF SERVICE uimode: DUMP OF SERVICE updatelock: DUMP OF SERVICE usagestats: DUMP OF SERVICE usb: DUMP OF SERVICE user: DUMP OF SERVICE vibrator: DUMP OF SERVICE voicesense: DUMP OF SERVICE wallpaper: DUMP OF SERVICE wifi: DUMP OF SERVICE wifip2p: DUMP OF SERVICE window:
從上面可以看出可以查看的Service非常多,“DUMP OF SERVICE”關鍵字後面的單詞都可以直接通過 dumpsys + 單詞 查看相關信息,具體每一個如何使用有一種通用的查看幫助的辦法。
查看每一個命令的使用幫助,以下以activity為例演示:
adb shell dumpsys activity -h Activity manager dump options: [-a] [-c] [-h] [cmd] ... cmd may be one of: a[ctivities]: activity stack state b[roadcasts] [PACKAGE_NAME] [history [-s]]: broadcast state i[ntents] [PACKAGE_NAME]: pending intent state p[rocesses] [PACKAGE_NAME]: process state o[om]: out of memory management prov[iders] [COMP_SPEC ...]: content provider state provider [COMP_SPEC]: provider client-side state s[ervices] [COMP_SPEC ...]: service state service [COMP_SPEC]: service client-side state package [PACKAGE_NAME]: all state related to given package all: dump all activities top: dump the top activity cmd may also be a COMP_SPEC to dump activities. COMP_SPEC may be a component name (com.foo/.myApp), a partial substring in a component name, a hex object identifier. -a: include all available server state. -c: include client state.這樣就可以清楚每個命名的使用方法以及對應輸出內容的信息查看方法。
adb shell dumpsys activity: 顯示activity的相關信息,包括任務棧等;
adb shell dumpsys SurfaceFlinger: 查看UI繪制的各個層級信息
adb shell dumpsys window: 顯示鍵盤,窗口和它們的關系
adb shell dumpsys statusbar: 顯示狀態欄相關信息
adb shell dumpsys usagestats: 每個應用的啟動次數和時間
adb shell dumpsys battery: 電池信息
adb shell dumpsys diskstats: 磁盤相關信息
adb shell dumpsys alarm: 顯示Alarm信息
adb shell dumpsys wifi: 顯示wifi信息
http://www.open-open.com/lib/view/open1405061994872.html
https://source.android.com/devices/tech/input/dumpsys.html
前言之前因為項目需求,其中使用到了圖片的單擊顯示取消,圖片平移縮放功能,昨天突然想再加上圖片的旋轉功能,在網上看了很多相關的例子,可是沒看到能同時實現我想要的功能的。需求
MainActivity如下:+currentStatus, Toast.LENGTH_SHORT).show(); } } } Sw
本文實例講述了Android使用WebView播放flash及判斷是否安裝flash插件的方法。分享給大家供大家參考。具體實現方法如下:一、問題:最近幫一個同學做一個項目
我們在開發Android上應用程序時,有很多時候會遇到“延時”等待的情況,例如數據加載時,尤其是在聯網的時候,請求網絡會有個等待時間