ADB的全称为Android Debug Bridge,就是起到调试桥的作用。ADB是android sdk(Android专属的软件开发工具包)里的一个工具, 用这个工具可以直接操作管理android模拟器或者真实的andriod设备(如DEFY). 它的主要功能有:
模拟器在运行一段时间后,adb服务有可能出现异常。这时需要重新对adb服务关闭和重启,执行如下命令。如果还不行,重新插一下usb,重启下eclipse:
C:\Users\zejun>adb kill-server
C:\Users\zejun>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
C:\Users\zejun>adb shell cat /proc/cpuinfo
Processor : ARMv7 Processor rev 1 (v7l)
processor : 0
BogoMIPS : 4.80
processor : 1
BogoMIPS : 4.80
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 1
Hardware : prototd
Revision : 0080
Serial : 0000000000000000
C:\Users\zejun>adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
1000000
C:\Users\zejun>adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
400000
C:\Users\zejun>adb shell cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq
400000
C:\Users\zejun>adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
400000
C:\Users\zejun>adb shell cat /proc/meminfo
MemTotal: 926832 kB
MemFree: 200940 kB
Buffers: 46224 kB
Cached: 258516 kB
SwapCached: 0 kB
Active: 420852 kB
Inactive: 157956 kB
。。。
VmallocTotal: 516096 kB
VmallocUsed: 193980 kB
VmallocIoRemap: 183140 kB
VmallocAlloc: 164 kB
VmallocMap: 10676 kB
VmallocUserMap: 0 kB
VmallocVpage: 0 kB
VmallocChunk: 243652 kB
//HTC_KER_MARK ION_Alloc: 274 kB
adb shell dumpsys meminfo $pid
adb shell dumpsys meminfo $packageName
例子:
C:\Users\zejun>adb shell dumpsys meminfo
Applications Memory Usage (kB):
Uptime: 52456758 Realtime: 280954126
Total PSS by process:
41349 kB: system (pid 1852)
35235 kB: com.android.settings (pid 3398)
21113 kB: com.android.systemui (pid 1988)
18484 kB: com.htc.launcher (pid 2121)
14571 kB: com.htc.android.htcime (pid 2046)
13331 kB: android.process.media (pid 2183)
12829 kB: com.android.phone (pid 2060)
10919 kB: android.process.acore (pid 2280)
9361 kB: com.android.htcdialer (pid 2083)
8946 kB: com.android.sr (pid 2067)
7940 kB: com.htc.bgp (pid 8568)
7746 kB: com.android.htccontacts (pid 11786)
7378 kB: com.htc.MediaCacheService (pid 10954)
7202 kB: com.htc.android.mail:sync (pid 11715)
7015 kB: com.htc.htcpowermanager:remote (pid 4061)
6146 kB: com.htc.sdm (pid 10981)
5551 kB: com.android.process.ncm (pid 2088)
5441 kB: com.newbee.optimize (pid 11850)
5027 kB: com.htc.musicenhancer (pid 10967)
5014 kB: com.htc.android.worldclock (pid 11265)
4915 kB: com.htc.lockscreen (pid 10890)
4865 kB: com.htc.musicenhancer:enhancerprovider (pid 11902)
4864 kB: com.htc.android.omadm.service (pid 12228)
4856 kB: com.htc.weather.bg (pid 11832)
4850 kB: com.smithmicro.DM (pid 12143)
4365 kB: android.htc.china.location.service (pid 2226)
4317 kB: com.tencent.nanji.updater (pid 12034)
Total PSS by OOM adjustment:
99149 kB: Persistent
41349 kB: system (pid 1852)
21113 kB: com.android.systemui (pid 1988)
12829 kB: com.android.phone (pid 2060)
9361 kB: com.android.htcdialer (pid 2083)
8946 kB: com.android.sr (pid 2067)
5551 kB: com.android.process.ncm (pid 2088)
35235 kB: Foreground
35235 kB: com.android.settings (pid 3398)
27902 kB: Perceptible
14571 kB: com.htc.android.htcime (pid 2046)
13331 kB: android.process.media (pid 2183)
18484 kB: Home
18484 kB: com.htc.launcher (pid 2121)
5441 kB: A Services
5441 kB: com.newbee.optimize (pid 11850)
4864 kB: B Services
4864 kB: com.htc.android.omadm.service (pid 12228)
92555 kB: Background
10919 kB: android.process.acore (pid 2280)
7940 kB: com.htc.bgp (pid 8568)
7746 kB: com.android.htccontacts (pid 11786)
7378 kB: com.htc.MediaCacheService (pid 10954)
7202 kB: com.htc.android.mail:sync (pid 11715)
7015 kB: com.htc.htcpowermanager:remote (pid 4061)
6146 kB: com.htc.sdm (pid 10981)
5027 kB: com.htc.musicenhancer (pid 10967)
5014 kB: com.htc.android.worldclock (pid 11265)
4915 kB: com.htc.lockscreen (pid 10890)
4865 kB: com.htc.musicenhancer:enhancerprovider (pid 11902)
4856 kB: com.htc.weather.bg (pid 11832)
4850 kB: com.smithmicro.DM (pid 12143)
4365 kB: android.htc.china.location.service (pid 2226)
4317 kB: com.tencent.nanji.updater (pid 12034)
Total PSS by category:
146388 kB: Dalvik
57999 kB: Unknown
43580 kB: .dex mmap
23934 kB: .so mmap
3991 kB: Other dev
3890 kB: .apk mmap
2107 kB: .ttf mmap
1703 kB: Other mmap
28 kB: Cursor
8 kB: .jar mmap
2 kB: Ashmem
0 kB: Native
Total PSS: 283630 kB
KSM: 0 kB saved from shared 0 kB
0 kB unshared; 0 kB volatile
例子:
C:\Users\zejun>adb shell dumpsys meminfo com.example.demoapp
Applications Memory Usage (kB):
Uptime: 52836362 Realtime: 281333729
** MEMINFO in pid 12396 [com.example.demoapp] **
Shared Private Heap Heap
Pss Dirty Dirty Size Alloc
------ ------ ------ ------ ------
Native 0 0 0 10208 10123
Dalvik 3186 1780 3088 2972 1434
Cursor 0 0 0
Ashmem 0 0 0
Other dev 3005 52 0
.so mmap 1159 1008 580
.jar mmap 0 0 0
.apk mmap 82 0 0
.ttf mmap 215 0 0
.dex mmap 763 144 232
Other mmap 31 16 28
Unknown 2349 5708 2160
TOTAL 10790 8708 6088 13180 11557
Objects
Views: 27 ViewRootImpl: 1
AppContexts: 3 Activities: 1
Assets: 6 AssetManagers: 6
Local Binders: 7 Proxy Binders: 14
Death Recipients: 0
OpenSSL Sockets: 0
SQL
MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/data/app/com.example.demoapp-1.apk:/resources.arsc: 2K
Uptime: 52836511 Realtime now=281333878
具体的参数参见:
http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android#2299813
Terms
dalvik:是指dalvik所使用的内存。 native:是被native堆使用的内存。应该指使用C\C++在堆上分配的内存。
VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存)
PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS
adb logcat -c && adb logcat -s ActivityManager
eg:
C:\Users\zejun.lzj>adb logcat -c && adb logcat -s ActivityManager | findstr "Disp
layed"
I/ActivityManager( 1852): Displayed com.tmall.wireless/.module.main.TMMainTabAct
ivity: +832ms
I/ActivityManager( 1852): Displayed com.tmall.wireless/.test.TMTestActivity: +4s
723ms
I/ActivityManager( 1852): Displayed com.tmall.wireless/.module.main.TMMainTabAct
ivity: +3s332ms
I/ActivityManager( 1852): Displayed com.tmall.wireless/.module.tmallbrowser.TMal
lBrowserActivity: +263ms
用ADB查看手机的相关信息参数:
#查看全部属性
C:\Users\zejun>adb shell getprop > d:/prot.txt
#查看机器的序列号
C:\Users\zejun>adb shell getprop ro.serialno
HC2B9LY07287
#查看机器的CID号
C:\Users\zejun>adb shell getprop ro.carrier
#查看SPL(Hboot)版本号
C:\Users\zejun>adb shell getprop ro.bootloader
0.76.0000
#重启手机
adb reboot
#重启手机到recovery界面
adb reboot recovery
#重启手机到bootloader界面
adb reboot bootloader
C:\Users\zejun>adb shell dumpsys cpuinfo
Load: 0.12 / 0.1 / 0.12
CPU usage from 39708ms to 33094ms ago:
1% 1852/system_server: 0.6% user + 0.4% kernel
0.6% 1550/zchgd: 0.1% user + 0.4% kernel / faults: 1368 minor
0.3% 882/mmcqd/0: 0% user + 0.3% kernel
0% 7/rcuc0: 0% user + 0% kernel
0% 1552/htc_ebdlogd: 0% user + 0% kernel
0.1% 1988/com.android.systemui: 0.1% user + 0% kernel
0% 4061/com.htc.htcpowermanager:remote: 0% user + 0% kernel / faults: 4 minor
0.1% 12172/kworker/u:2: 0% user + 0.1% kernel
1.7% TOTAL: 0.5% user + 0.9% kernel + 0.2% iowait
当前运行的服务:
C:\Users\zejun>adb shell service list
Found 80 services:
0 htctelephony: [com.android.internal.telephony.IHtcTelephony]
1 phone: [com.android.internal.telephony.ITelephony]
2 htctelephonyinternal: [com.android.internal.telephony.IHtcTelephonyInte
nal]
3 iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
4 simphonebook: [com.android.internal.telephony.IIccPhoneBook]
5 isms: [com.android.internal.telephony.ISms]
6 NewbeeSecurityScanManager: [android.securityscan.INewbeeSecurityScan]
7 wireless_display: [com.htc.service.IWirelessDisplayService]
8 commontime_management: []
9 bt_fm_management: [com.broadcom.bt.service.framework.IPowerManager]
10 bluetooth_hid: [com.broadcom.bt.service.hid.IBluetoothHID]
11 userbehavior: [com.htc.utils.ulog.IUserBehaviorLoggingService]
12 samplingprofiler: []
13 diskstats: []
14 appwidget: [com.android.internal.appwidget.IAppWidgetService]
15 backup: [android.app.backup.IBackupManager]
16 uimode: [android.app.IUiModeManager]
17 serial: [android.hardware.ISerialManager]
18 usb: [android.hardware.usb.IUsbManager]
19 audio: [android.media.IAudioService]
20 wallpaper: [android.app.IWallpaperManager]
21 dropbox: [com.android.internal.os.IDropBoxManagerService]
22 search: [android.app.ISearchManager]
23 country_detector: [android.location.ICountryDetector]
24 location: [android.location.ILocationManager]
25 devicestoragemonitor: []
26 display: [android.os.IDisplayService]
27 notification: [android.app.INotificationManager]
28 updatelock: [android.os.IUpdateLock]
29 throttle: [android.net.IThrottleManager]
30 servicediscovery: [android.net.nsd.INsdManager]
31 connectivity: [android.net.IConnectivityManager]
32 usbnet: [com.htc.net.usbnet.IUsbnetController]
33 wifi: [android.net.wifi.IWifiManager]
34 wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
35 netpolicy: [android.net.INetworkPolicyManager]
36 netstats: [android.net.INetworkStatsService]
37 textservices: [com.android.internal.textservice.ITextServicesManager]
38 network_management: [android.os.INetworkManagementService]
39 clipboard: [android.content.IClipboard]
40 statusbar: [com.android.internal.statusbar.IStatusBarService]
41 device_policy: [android.app.admin.IDevicePolicyManager]
42 lock_settings: [com.android.internal.widget.ILockSettings]
43 mount: [IMountService]
44 gesture: [com.htc.service.IGestureService]
45 accessibility: [android.view.accessibility.IAccessibilityManager]
46 input_method: [com.android.internal.view.IInputMethodManager]
47 bluetooth_a2dp: [android.bluetooth.IBluetoothA2dp]
48 bluetooth: [android.bluetooth.IBluetooth]
49 input: [android.hardware.input.IInputManager]
50 window: [android.view.IWindowManager]
51 alarm: [android.app.IAlarmManager]
52 htchardware: [android.os.IHtcHardwareService]
53 vibrator: [android.os.IVibratorService]
54 battery: []
55 hardware: [android.os.IHardwareService]
56 content: [android.content.IContentService]
57 account: [android.accounts.IAccountManager]
58 permission: [android.os.IPermissionController]
59 cpuinfo: []
60 dbinfo: []
61 gfxinfo: []
62 meminfo: []
63 activity: [android.app.IActivityManager]
64 package: [android.content.pm.IPackageManager]
65 scheduling_policy: [android.os.ISchedulingPolicyService]
66 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]
67 HtcAppUsageStatsService: [com.android.internal.app.IHtcAppUsageStatsSer
ice]
68 usagestats: [com.android.internal.app.IUsageStats]
69 batteryinfo: [com.android.internal.app.IBatteryStats]
70 power: [android.os.IPowerManager]
71 entropy: []
72 sensorservice: [android.gui.SensorServer]
73 media.audio_policy: [android.media.IAudioPolicyService]
74 media.camera: [android.hardware.ICameraService]
75 SurfaceFlinger: [android.ui.ISurfaceComposer]
76 media.player: [android.media.IMediaPlayerService]
77 media.audio_flinger: [android.media.IAudioFlinger]
78 drm.drmManager: [drm.IDrmManagerService]
79 rootstub: [com.newbee.nanji.rootstub.IRootStub]
C:\Users\zejun>adb shell cat /system/build.prop
ro.ril.oem.ecclist=112,000,08,110,118,119,911,999
ro.ril.enable.a52=0
ro.ril.enable.a53=1
ro.ril.gprsclass=12
ro.ril.fast.dormancy.rule=1
ro.ril.radio.svn=1
ro.ril.disable.fd.plmn.prefix=23402,23410,23411,23420
ro.ril.enable.sdr=0
ril.watchdog.ping_address=www.baidu.com
ro.product.locale.language=zh
ro.product.locale.region=CN
ro.com.google.clientidbase=android-htc
ro.phone.min_match=11
ro.product.model=HTC T329t
ro.htc.checkin.delay=0
dev.deviceimage_large=/system/customize/resource/Primo_TD_187x370.png
dev.deviceimage_small=/system/customize/resource/primo_TD_32x58.png
ro.ril.def.agps.mode=2
# begin build properties
# autogenerated by buildinfo.sh
htc.build.stage=2
ro.aa.customizationid=513153
ro.aa.project=PROTO_TD_JB_45A_S
ro.prot=true
ro.aa.romver=2.10.1403.1
ro.aa.maincid=HTCCN704
ro.aa.cidlist=HTCCN704
ro.aa.rid=28
ro.aa.modelid=PK7920000
ro.aa.report=com
ro.aa.skulist=1403
ro.aa.mainsku=1403
ro.ril.hsxpa=1
ro.onecid=1
ro.cwkey=HTCCN704
ro.aa.taskid=316656
ro.com.google.clientidbase=android-htc
ro.build.id=JRO03H
ro.build.display.id=JRO03H
ro.build.version.incremental=180667.1
ro.build.version.sdk=16
ro.build.version.codename=REL
ro.build.version.release=4.1.1
ro.build.date=浜? 4鏈?19 15:04:20 CST 2013
ro.build.date.utc=1366355060
ro.build.type=user
ro.build.user=
ro.build.host=abm018
ro.build.tags=release-keys
ro.product.model=HTC ProtoTD
ro.product.brand=htccn_chs_cmcc
ro.product.name=prototd
ro.product.device=prototd
ro.product.board=prototd
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=htc
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=prototd
# ro.build.product is obsolete; use ro.product.device
ro.build.product=prototd
ro.build.description=2.10.1403.1 CL180667 release-keys
ro.build.description=2.10.1403.1 CL180667 release-keys
ro.build.changelist=180667
ro.build.fingerprint=htccn_chs_cmcc/prototd/prototd:4.1.1/JRO03H/180667.1:user/r
elease-keys
ro.build.characteristics=default
ro.build.project=PROTO_TD_JB_45A_S:316656
ro.product.version=2.10.1403.1
ro.build.languageremove=0
ro.build.sense.version=4.5
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=2.10.1403.1 CL180667 release-keys
ro.build.fingerprint=htccn_chs_cmcc/prototd/prototd:4.1.1/JRO03H/180667.1:user/r
elease-keys
ro.build.characteristics=default
keyguard.no_require_sim=1
# end build properties
#
# system.prop for ProtoTD
#
# Default network type.
ro.telephony.default_network=0
# For DSDA two RIL architecture - add network type gsm is 0, cdma is 4
ro.default_network.gsm = 0
# For CP2_DTG two RIL architecture - multi-rild architecture
ro.multi.rild = 1
ro.ril.oem.normalcall.ecclist=110,119
# Non-U8500 modem's interface for radio router under DSDA
radiorouter.dev.s=/dev/ttyMux0
# Graphics related configurations
ro.sf.lcd_density=240
ro.sf.display_rotation=0
# The OpenGL ES API level that is natively supported by this device.
# This is a 16.16 fixed point number
ro.opengles.version=131072
# Enable RecoverySystem to emit "factory-reset" reset string
# instead of "recovery" when doing a factory reset. This is
# useful when implementing factory reset without the entire
# recovery framework.
ro.factoryresetwithoutrecovery=true
ro.product.wifi=802.11 b/g/n
wifi.interface=wlan0
wifi.supplicant_scan_interval=15
wifi.softap.interface=wlan0
wifi.softapconcurrent.interface=wl0.1
# debug.sf.hw=0 Use b2r2 as compositor in SurfaceFlinger
# debug.sf.hw=1 Use Mali as compositor in SurfaceFlinger
debug.sf.hw=1
# Android defaults EGL preserved swap behaviour
# This gives bad performace for deferred renderers
# such as Mali.
hwui.render_dirty_regions=false
# Set dalvik heapsize to 48MB
#dalvik.vm.heapsize=48m
# This is a high density device with more memory, so larger vm heaps for it.
dalvik.vm.heapsize=128m
dalvik.vm.heapgrowthlimit=48m
# STE: Low power audio - enable ULP mode
ste.nmf.autoidle=1
# STE: Address of DBus STE bus
ste.dbus.bus.address=unix:path=/dev/socket/dbus_ste
# STE: UNSOL_CALL_RING is only sent once from RIL.
# Android needs to generate more rings if needed.
ro.telephony.call_ring.multiple=false
# STE: Hardware video codecs configuration
ste.video.dec.mpeg4.in.size=8192
ste.video.enc.out.buffercnt=5
ste.video.dec.recycle.delay=1
#STE: Video Encoder Input Color Format Supported: yuv420mb for SVA based encoder
ste.video.enc.fmt=yuv420mb
#STE: Fast Dormancy Flag
# Fast Dormancy based on USB Tether Events and Screen States
ste.special_fast_dormancy=false
# STE: camera orientation front & back
ste.cam.front.orientation=270
ste.cam.back.orientation=90
# STE: Camera file path configuration
ste.cam.ext.cfg.path.secondary=/system/usr/share/camera/config_file/aptina_mt9v1
13.dat
# STE: Default trace configuration
ste.omx.ctx=0
#WA to disable dsp dump for dsp panic
ste.nmf.dsp.nodump=1
# STE: H264Dec Profile level configuration
ste.video.decoder.h264.max.lev=5.1
ste.video.decoder.h264.def.lev=4.2
# For emmc phone storage
ro.phone_storage = 1
# For ext4 file system
ro.ext4fs = 1
# Following property will be reference by Settings.
ro.product.processor = 1 GHz dualcore
ro.product.ram = 1024MB
ro.product.display_resolution = 4 inch WVGA resolution
ro.product.main_camera = 5M
ro.product.front_camera = NA
ro.product.bluetooth = 4.0
ro.product.wifi = 802.11 b/g/n
# HTC_DISP_START samuel.lh_huang For Patch GPUBench VMAbort
dalvik.vm.checkjni=false
# Properties of BTLA stack
service.brcm.bt.activation = 0
service.brcm.bt.srv_active = 0
service.brcm.bt.hcid_active = 0
service.brcm.bt.btld = 0
service.brcm.bt.btld_pid = 0
service.brcm.bt.avrcp_pass_thru = 0
service.brcm.bt.avrcp_toggle = 1
service.brcm.bt.local_name =
service.brcm.bt.FTS_ROOT_FOLDER = /storage
# PCM settings for BTLA (clk = 256kHz)
service.brcm.bt.pcm_clk=1
# HTC_AUD_START export for SoundHound
persist.htc.audio.pcm.samplerate=44100
persist.htc.audio.pcm.channels=2
#
# ADDITIONAL_BUILD_PROPERTIES
#
debug.nfc.fw_download=true
debug.nfc.fw_boot_download=false
ro.com.google.clientidbase=android-ste
htc.audio.swalt.enable=1
htc.audio.hac.enable=1
htc.audio.global.state=0
htc.audio.global.profile=0
htc.audio.beats.state=1
lpa.use-stagefright=true
htc.audio.beats.config=1
htc.audio.alc.enable=1
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
ro.newbee.device=T329t
ro.newbee.brand=HTC
dev.defaultwallpaper=/system/customize/resource/newbee1.jpg
# simon Language Set
persist.sys.language=zh
persist.sys.country=CN
persist.sys.timezone=Asia/Shanghai
newbee_powersave_enable=1
newbee_permission_enable=0
newbee_security_scan_enable=1
romzj.rom.id=31b034ba-119b-4826-af66-be6e6f678af5
romzj.rom.version=T329t_newbee_4.03.24.18_release_V3.7
romzj.rom.version.code=4
romjd.rom.id=4eff734d-ac2b-458b-af83-a56db79661d1
romjd.rom.version=T329t_newbee_4.03.24.18
romjd.rom.version.code=1
ro.build.version.newbee.display=newbee_4.03.24.18_release_V3.7
ro.build.newbee.releaseTime=1395768010
C:\Users\zejun>adb shell dumpsys package com.tmall.wireless
Activity Resolver Table:
Full MIME Types:
image/*:
4196eb50 com.tmall.wireless/.module.postv2.TMPostCreateActivity filter
196eb78
Wild MIME Types:
image:
4196eb50 com.tmall.wireless/.module.postv2.TMPostCreateActivity filter
196eb78
Schemes:
itmall:
418a2b88 com.tmall.wireless/.activity.TMSplashActivity filter 418eeca8
tmall:
418a2b88 com.tmall.wireless/.activity.TMSplashActivity filter 418b62c0
418a2b88 com.tmall.wireless/.activity.TMSplashActivity filter 418faa48
http:
41985f20 com.tmall.wireless/.module.detail.TMItemDetailsActivity filte
41ae6430
41985f20 com.tmall.wireless/.module.detail.TMItemDetailsActivity filte
41aee818
41985f20 com.tmall.wireless/.module.detail.TMItemDetailsActivity filte
41af4450
41985f20 com.tmall.wireless/.module.detail.TMItemDetailsActivity filte
41b567e8
com.tmall.wireless.post.topic:
41da7de0 com.tmall.wireless/.module.postv2.TMPostLabelDetailActivity f
ter 41cf6e80
Non-Data Actions:
com.tmall.wireless.homepage.start:
418faad8 com.tmall.wireless/.homepage.activity.TMHomePageActivity filt
4191ad90
com.tmall.wireless.mbuy.order:
41aa9bf8 com.tmall.wireless/.mbuy.TMOrderMbuyActivity filter 41aa9ea0
com.alipay.mobilepay.android:
41b99ad0 com.tmall.wireless/com.alipay.android.mini.window.sdk.MiniLau
erActivity filter 41be1ca0
android.intent.action.MAIN:
42136338 com.tmall.wireless/.module.launchalert.TMLaunchAlertActivity
lter 421ac818
41b671d8 com.tmall.wireless/.module.shopdetails.TMShopDetailSlideActiv
y filter 419accb8
41bac748 com.tmall.wireless/.module.main.TMShortCutActivity filter 41a
130
41c632a8 com.tmall.wireless/.test.TMTestActivity filter 41c2e890
41c2d2b8 com.tmall.wireless/com.alipay.android.mini.window.sdk.MiniPay
tivity filter 41c46560
41c65af8 com.tmall.wireless/com.alipay.android.mini.window.sdk.MiniWeb
tivity filter 41c767e0
com.tmall.wireless.mystreet.start:
4155d5a0 com.tmall.wireless/.mystreet.activity.TMMyStreetIndexActivity
ilter 42130b08
com.sina.weibo.sdk.action.ACTION_SDK_REQ_ACTIVITY:
41a89178 com.tmall.wireless/.activity.TMShareWeiboActivity filter 41a8
28
MIME Typed Actions:
android.intent.action.SEND:
4196eb50 com.tmall.wireless/.module.postv2.TMPostCreateActivity filter
196eb78
Receiver Resolver Table:
Schemes:
package:
41d95550 com.tmall.wireless/com.taobao.agoo.RegistrationReceiver filte
41d95908
Non-Data Actions:
com.taobao.calendar.sdk.alarmTmall.PLAY:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
com.laiwang.app.register:
41c82590 com.tmall.wireless/com.laiwang.openapi.LWReceiver filter 41d8
60
com.tmall.wireless.intent.action.COMMAND:
41d94368 com.tmall.wireless/com.taobao.agoo.PushServiceReceiver filter
1c30538
android.net.conn.CONNECTIVITY_CHANGE:
41d95550 com.tmall.wireless/com.taobao.agoo.RegistrationReceiver filte
41da7500
41c76020 com.tmall.wireless/.receiver.TMBootCompletedReceiver filter 4
765d0
41d286d0 com.tmall.wireless/com.alipay.mobile.datatunnel.ext.trigger.A
payDataTunnelTrigger filter 41d9b398
com.taobao.calendar.sdk.alarmTmall.KILL:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
com.tmall.wireless.plugin_start_failed:
41af1130 com.tmall.wireless/.atlas.pluginmanager.TMPluginFailedBroadca
Receiver filter 41af1158
org.agoo.android.intent.action.RE_ELECTION_V2:
41d94368 com.tmall.wireless/com.taobao.agoo.PushServiceReceiver filter
1bf84b0
com.taobao.calendar.sdk.alarmTmall.TIMEOUT:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
android.intent.action.BOOT_COMPLETED:
41c76020 com.tmall.wireless/.receiver.TMBootCompletedReceiver filter 4
765d0
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c8c510
android.appwidget.action.APPWIDGET_UPDATE:
4123b050 com.tmall.wireless/.widget.TMSearchAppWidget filter 41403090
414ceab0 com.tmall.wireless/.widget.TMPrepayAppWidget filter 41bc8bf0
com.taobao.calendar.sdk.alarmTmall.RESET:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
android.intent.action.LOCALE_CHANGED:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
android.intent.action.TIME_SET:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
org.agoo.android.intent.action.RECEIVE:
41d94368 com.tmall.wireless/com.taobao.agoo.PushServiceReceiver filter
1d2bc60
com.taobao.calendar.sdk.alarmTmall.STOP:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
android.intent.action.TIMEZONE_CHANGED:
41c73af8 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
eceiver filter 41c785a8
com.laiwang.app.send:
41c82590 com.tmall.wireless/com.laiwang.openapi.LWReceiver filter 41d8
60
Service Resolver Table:
Non-Data Actions:
com.taobao.calendar.sdk.alarmTmall.PLAY:
41ba9f48 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
ervice filter 41c63788
com.taobao.calendar.sdk.alarmTmall.RESET:
41ba9f48 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
ervice filter 41c63788
com.tmall.wireless.intent.action.START:
41ada4b0 com.tmall.wireless/com.taobao.agoo.PushService filter 41d6a25
com.tmall.wireless.intent.action.COCKROACH:
41ada4b0 com.tmall.wireless/com.taobao.agoo.PushService filter 41db04c
com.taobao.calendar.sdk.alarmTmall.ACCEPT:
41ba9f48 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
ervice filter 41c63788
android.accounts.AccountAuthenticator:
42251698 com.tmall.wireless/com.taobao.android.sso.internal.Authentica
onService filter 41d9b1a8
org.agoo.android.intent.action.PING:
41ada4b0 com.tmall.wireless/com.taobao.agoo.PushService filter 41db34a
com.taobao.calendar.sdk.alarmTmall.STOP:
41ba9f48 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
ervice filter 41c63788
org.agoo.android.intent.action.ELECTION_V2:
41dbe918 com.tmall.wireless/org.android.agoo.service.ElectionService f
ter 41dc4ce0
com.alipay.mobile.datatunnel.ext.action.MAIN:
41c8e5e0 com.tmall.wireless/com.alipay.mobile.datatunnel.ext.AlipayDat
unnelService filter 41c9e430
com.taobao.calendar.sdk.alarmTmall.KILL:
41ba9f48 com.tmall.wireless/com.taobao.calendar.sdk.alarm.CalendarAlar
ervice filter 41c63788
Permissions:
Permission [com.taobao.permission.UPDATE_CREDENTIALS] (423d1928):
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=dangerous
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{41976f98 com.taobao.permission.UPDATE_CREDENTIALS}
Permission [com.tmall.wireless.address.permission.READ_SETTINGS] (423d1a18):
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=normal
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{41ad7888 com.tmall.wireless.address.permission.READ_SETTIN
}
Permission [org.agoo.android.permission.MESSAGE] (423d19a0):
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=normal
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{419a88d0 org.agoo.android.permission.MESSAGE}
Permission [com.taobao.permission.USE_CREDENTIALS] (423d1680):
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=dangerous
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{419179e0 com.taobao.permission.USE_CREDENTIALS}
Permission [com.tmall.wireless.privateinfo.permission.READ_MESSAGE] (423d1b0
:
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=signature
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{415ac890 com.tmall.wireless.privateinfo.permission.READ_ME
AGE}
Permission [com.tmall.wireless.address.permission.WRITE_SETTINGS] (423d1a90)
sourcePackage=com.tmall.wireless
uid=10092 gids=[] type=0 prot=normal
packageSetting=PackageSetting{420afc08 com.tmall.wireless/10092}
perm=Permission{41d1ec28 com.tmall.wireless.address.permission.WRITE_SETTI
S}
Registered ContentProviders:
com.tmall.wireless/.wangxin.provider.WXProvider:
Provider{418a44e0 com.tmall.wireless.wangxin.provider.WXProvider}
ContentProvider Authorities:
[com.tmall.wireless.wangxin.provider]:
Provider{418a44e0 com.tmall.wireless.wangxin.provider.WXProvider}
applicationInfo=ApplicationInfo{418bf1a0 com.tmall.wireless}
Packages:
Package [com.tmall.wireless] (420afc08):
userId=10092 gids=[3003, 1015, 1006, 1028]
sharedUser=null
pkg=Package{418acda0 com.tmall.wireless}
codePath=/data/app/com.tmall.wireless-1.apk
resourcePath=/data/app/com.tmall.wireless-1.apk
nativeLibraryPath=/data/data/com.tmall.wireless/lib
versionCode=38
applicationInfo=ApplicationInfo{418bf1a0 com.tmall.wireless}
flags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
versionName=4.2.0
dataDir=/data/data/com.tmall.wireless
targetSdk=8
supportsScreens=[small, medium, large, resizeable, anyDensity]
timeStamp=2014-08-13 11:46:47
firstInstallTime=2014-08-13 11:46:51
lastUpdateTime=2014-08-13 11:46:51
signatures=PackageSignatures{41b2d258 [41f813d8]}
permissionsFixed=true haveGids=true
pkgFlags=0x0 installStatus=1 User 0: stopped=false enabled=0
enabledComponents:
com.taobao.calendar.sdk.alarm.CalendarAlarmReceiver
com.tmall.wireless.widget.TMSearchAppWidget
com.tmall.wireless.atlas.pluginmanager.TMPluginFailedBroadcastReceiver
com.laiwang.openapi.LWReceiver
com.tmall.wireless.widget.TMPrepayAppWidget
com.taobao.agoo.PushServiceReceiver
com.alipay.mobile.datatunnel.ext.trigger.AlipayDataTunnelTrigger
com.tmall.wireless.receiver.TMBootCompletedReceiver
com.taobao.android.sso.internal.AuthenticationService
com.taobao.agoo.RegistrationReceiver
grantedPermissions:
android.permission.READ_EXTERNAL_STORAGE
android.permission.GET_TASKS
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.ACCESS_WIFI_STATE
android.permission.ACCESS_COARSE_LOCATION
android.permission.GET_ACCOUNTS
android.permission.AUTHENTICATE_ACCOUNTS
android.permission.READ_PHONE_STATE
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.CAMERA
org.agoo.android.permission.MESSAGE
com.taobao.permission.USE_CREDENTIALS
android.permission.ACCESS_FINE_LOCATION
android.permission.MANAGE_ACCOUNTS
android.permission.FLASHLIGHT
android.permission.ACCESS_NETWORK_STATE
android.permission.WAKE_LOCK
android.permission.RECORD_AUDIO
com.android.launcher.permission.INSTALL_SHORTCUT
com.taobao.permission.UPDATE_CREDENTIALS
android.permission.USE_CREDENTIALS
com.tmall.wireless.privateinfo.permission.READ_MESSAGE
android.permission.MODIFY_AUDIO_SETTINGS
android.permission.SYSTEM_ALERT_WINDOW
android.permission.INTERNET
android.permission.WRITE_SETTINGS
android.permission.CHANGE_WIFI_STATE
android.permission.VIBRATE
android.permission.CHANGE_NETWORK_STATE
流量消耗值通过查询uid_stat中使用前后的数据进行对比:
在使用前
C:\Users\zejun>adb shell cat /proc/uid_stat/10092/tcp_rcv
1062778
C:\Users\zejun>adb shell cat /proc/uid_stat/10092/tcp_snd
62426
使用后
C:\Users\zejun>adb shell cat /proc/uid_stat/10092/tcp_rcv
4628007
C:\Users\zejun>adb shell cat /proc/uid_stat/10092/tcp_snd
169585
查找pid:
C:\Users\zejun.lzj>adb shell ps|findstr tmall
u0_a92 10015 1538 332688 40984 ffffffff 40106a50 S com.tmall.wireless:push
u0_a92 12271 1538 443804 108556 ffffffff 40106a50 S com.tmall.wireless
u0_a92 13467 1538 324724 42416 ffffffff 40106a50 S com.tmall.wireless:notify
u0_a92 14779 1538 305916 29700 ffffffff 40106a50 S com.tmall.wireless:containerprocess1
查看CPU状态:
C:\Users\zejun>adb shell cat /proc/1538/stat 1538 (zygote) S 1 1538 0 0 -1 4194560 37514 3569524 204 678 408 1147 103730 4546 1 20 0 4 0 241 277569536 6745 4294967295 1074204672 1074209087 3203660336 320365 9256 1074814104 0 4612 0 103656 4294967295 0 0 17 1 0 0 0 0 0
参考文档: http://blog.csdn.net/cybertan/article/details/7596633
系统中的包名
显示系统中全部Android平台:
android list targets
显示系统中全部AVD(模拟器):
android list avd
创建AVD(模拟器):
android create avd --name 名称 --target 平台编号
启动模拟器:
emulator -avd 名称 -sdcard ~/名称.img (-skin 1280x800)
删除AVD(模拟器):
android delete avd --name 名称
创建SDCard:
mksdcard 1024M ~/名称.img
AVD(模拟器)所在位置:
Linux(~/.android/avd) Windows(C:\Documents and Settings\Administrator.android\avd)
启动DDMS:
ddms
显示当前运行的全部模拟器:
adb devices
对某一模拟器执行命令:
abd -s 模拟器编号 命令
安装应用程序:
adb install -r 应用程序.apk
获取模拟器中的文件:
adb pull
向模拟器中写文件:
adb push
进入模拟器的shell模式:
adb shell
启动SDK,文档,实例下载管理器:
android
缷载apk包:
adb shell
cd data/app
rm apk包
exit
adb uninstall apk包的主包名
adb install -r apk包
查看adb命令帮助信息:
adb help
在命令行中查看LOG信息:
adb logcat -s 标签名
adb shell后面跟的命令主要来自:
源码\system\core\toolbox目录和源码\frameworks\base\cmds目录。
删除系统应用:
adb remount (重新挂载系统分区,使系统分区重新可写)。
adb shell
cd system/app
rm *.apk
获取管理员权限:
adb root
启动Activity:
adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。
23、发布端口:
你可以设置任意的端口号,做为主机向模拟器或设备的请求端口。如:
adb forward tcp:5555 tcp:8000
24、复制文件:
你可向一个设备或从一个设备中复制文件, 复制一个文件或目录到设备或模拟器上:
adb push
如:adb push test.txt /tmp/test.txt
从设备或模拟器上复制一个文件或目录:
adb pull
如:adb pull /addroid/lib/libwebcore.so .
25、搜索模拟器/设备的实例:
取得当前运行的模拟器/设备的实例的列表及每个实例的状态:
adb devices
26、查看bug报告: adb bugreport
27、记录无线通讯日志:
adb shell
logcat -b radio
28、获取设备的ID和序列号:
adb get-product
adb get-serialno
29、访问数据库SQLite3
adb shell
sqlite3
TOTAL: 0.4% user + 0.4% kernel + 0% iowait