性能测试方法总结

时间:2015-03-02 13:01:19   收藏:0   阅读:1511

1.查看某个应用的流量使用情况

adb shell cat /proc/net/xt_qtaguid/stats | findstr (uid#)

如:adb shell cat /proc/net/xt_qtaguid/stats | findstr 10063 (10063为微信uid)

26 wlan0 0x0 10063 0 454072 1151 93233 1713 454072 1151 0 0 0 0 93233 1713 0 0 0 0
27 wlan0 0x0 10063 1 8672660 6156 396296 5302 8672660 6156 0 0 0 0 396296 5302 0 0 0 0

其中第6和8列为 rx_bytes(接收数据)和tx_bytes(传输数据)包含tcp,udp等所有网络流量传输的统计。

备注:查看应用uid的方法

adb shell dumpsys package com.example.myapp | findstr userId=

 

2.发送命令模拟手机低电环境:

adb shell am broadcast -a android.intent.action.BATTERY_CHANGED --ei "level" 3 --ei "scale" 100

备注:引申~恢复出厂设置的方法

adb shell am broadcast -a android.intent.action.MASTER_CLEAR

拨打电话 :adb shell am start -a android.intent.action.CALL -d tel:10086

原文:http://www.cnblogs.com/penghong2014/p/4308311.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!