你好,游客 登录 注册 搜索
背景:
阅读新闻

Android中dumpsys函数介绍与使用

[日期:2012-12-11] 来源:blog.csdn.net/su1216  作者:su1216 [字体:大 中 小]

那么我们到底都可以dump一些什么呢?

其实最简单的办法就是执行dumpsys,看看其结果,下面是我手机中执行的结果(HTCg14)

# dumpsys
Currently running services:
  DeviceManager3LM
  Encryption3LMService
  HtcAppUsageStatsService
  SurfaceFlinger
  accessibility
  account
  activity
  alarm
  appwidget
  audio
  backup
  battery
  batteryinfo
  bluetooth
  bluetooth_a2dp
  bluetooth_hid
  bt_fm_management
  clipboard
  connectivity
  content
  country_detector
  cpuinfo
  device_policy
  devicestoragemonitor
  diskstats
  display
  drm.drmManager
  dropbox
  entropy
  gfxinfo
  hardware
  htc_checkin
  htchardware
  htctelephony
  htctelephonyinternal
  input_method
  iphonesubinfo
  isms
  location
  media.audio_flinger
  media.audio_policy
  media.camera
  media.player
  meminfo
  mount
  netpolicy
  netstats
  network_management
  notification
  package
  permission
  phone
  power
  samplingprofiler
  search
  secfirewall
  secloader
  sensorservice
  simphonebook
  sip
  statusbar
  stub_activity
  stub_audio
  stub_iphonesubinfo
  stub_isms
  stub_location
  stub_phone
  stub_telephony.registry
  telephony.registry
  textservices
  throttle
  uimode
  usagestats
  usb
  usbnet
  userbehavior
  vibrator
  wallpaper
  wifi
  wifip2p
  window
-------------------------------------------------------------------------------
DUMP OF SERVICE DeviceManager3LM:
-------------------------------------------------------------------------------
DUMP OF SERVICE Encryption3LMService:

由于dump service的log实在太长,我就截取了最前面的“Currently running services”和两个Service的dump信息

为什么DeviceManager3LM和Encryption3LMService后面没有内容?这和Service的内部实现有关,也许它只是写了一个空的dump函数,也许有什么其他条件。

这个问题一会再说,我们先看看这些Service都是在哪注册的

其中大部分Service都是在SystemServer中的main函数里注册的,它调用了一个叫init2的函数

public static final void init2() { 
    Slog.i(TAG, "Entered the Android system server!"); 
    Thread thr = new ServerThread(); 
    thr.setName("android.server.ServerThread"); 
    thr.start(); 
} 

init2非常简单,所有任务都交给新线程ServerThread来处理

linux
相关资讯       android dumpsys  android函数 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款