Android App???????????????
???????????? ???????[ 2016/8/9 13:21:55 ] ??????????????? app????
????Android App??????????????????????б??????????????????????????????????????????????????????ò???????????????????г???????????????????????????????????????????????????3-5?Σ???????????????????????????檔??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????2????????????Android??????????????iOS?????????????????????????????????????????????????????????????Ч?????????????????????????????????????????????????????
???????????
???????????????ε?????????????????????????????????????????????????????????????Щ????????????????????????????????????????????????????????????????????????У?1.??????2.???????3.CPU????????????????????4.????????????????????????????????????16??????±??????
????????????
????UI??????????????????
??????Android??????????????????к??????????????????????????????adb??????????????????API??????????????????????????????????????????????????????鷳????????????Ч???????????????????????????????????????к??????????????????????????????Appium??????????????η????????????????á????????????UI????????????÷??????????????ο???????????????????
???????????
????????CPU????棬FPS??????????????????????????????????????????UI????????е??????????adb?????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????Appium???????????????????????????????????????????????????м???????????????????????????д??????????????Χ??????????100ms?????????????????????
??????????
??????????????????????
?????????????????????????????????????????
@Override
public void run() {
// TODO Auto-generated method stub
this.running = true;
while (running) {
String time = String.valueOf(System.currentTimeMillis());
time = CalendarDate.GetCurrentTime();
//??????????
int [] memArray = AndroidPerformanceTools.getMemoryInfo(androidPerformance.getPkgname()?? androidPerformance.getDevice());
int totalMem = memArray[0];
int appMem = memArray[1];
//???CPU????
int cpuUsage = AndroidPerformanceTools.getCPUInfo(androidPerformance.getPkgname()?? androidPerformance.getDevice());
//???FPS
float fps = AndroidPerformanceTools.getFPSInfo(androidPerformance.getPkgname()?? androidPerformance.getDevice());
//???????????
long [] trafficArray = AndroidPerformanceTools.getTrafficInfo(androidPerformance.getPkgname()?? androidPerformance.getDevice());
long totalTrffic = trafficArray[0];
long recTraffic = trafficArray[1];
long sndTraffic = trafficArray[2];
//????????
if (this.androidPerformance.getAndroidPerformanceData().getInittotal() == -1
&& totalTrffic > 0) {
this.androidPerformance.getAndroidPerformanceData().setInittotal(totalTrffic);
this.androidPerformance.getAndroidPerformanceData().setInitrec(recTraffic);
this.androidPerformance.getAndroidPerformanceData().setInitsnd(sndTraffic);
}
//????????
MemInfo memInfo = new MemInfo(time?? totalMem?? appMem);
FPSInfo fpsInfo = new FPSInfo(time?? fps);
CPUInfo cpuInfo = new CPUInfo(time?? cpuUsage);
TrafficInfo trafficInfo = new TrafficInfo(time?? totalTrffic?? recTraffic?? sndTraffic);
this.androidPerformance.getAndroidPerformanceData().getCpuinfolist().add(cpuInfo);
this.androidPerformance.getAndroidPerformanceData().getMeminfolist().add(memInfo);
this.androidPerformance.getAndroidPerformanceData().getTraffinfolist().add(trafficInfo);
this.androidPerformance.getAndroidPerformanceData().getFpsinfolist().add(fpsInfo);
//???ò????????
try {
Thread.sleep(this.sleepTime);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
??????????????????
????????UI????????????ζ???????App?????????????????????????????????????????????????????檔?????????????????????????????????????UI?????????????action?м?????????Σ?startPerformance??stopPerformance???????????????????λ?ü?????????action??????????????????????????á???????????н???????????startPeformance???????????????????????stopPerformance???????????????????????????????????????????????????????
???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11