android 常用命令

1. dumpsys

adb shell dumpsys cpuinfo| grep packagename

dumpsys activit
dumpsys activity intents
dumpsys activity broadcasts
dumpsys activity providers
dumpsys activity services
dumpsys activity activities
dumpsys activity processes

获取当前activity名称
adb shell dumpsys window windows | findstr Current

获取当前activity的信息和包名
adb shell dumpsys activity top

2. am

adb shell am force-stop package

3. cold start and hot start

adb shell am start -W -n package/activity

4. pm

pm list packages 列出package信息
pm install 安装
pm uninstall 卸载
pm clear 清空数据
pm get-install-location

pm install

  1. 流量监控值的获取方法
    1.获取进程的ID
    adb shell ps | grep packagename
  2. 获取进程的ID流量
    adb shell cat/proc/pid/net/dev
    eth0、eth1 两个网卡的Receive 和Transmit即可
    流量= Recieve(app接收到的请求)+Transmit(app发出的请求)

5.内存
adb shell top

你可能感兴趣的:(android 常用命令)