应用启动时间

问题描述 投票:2回答:1

知道有多种方法可以使用adb logcat获取启动时间信息:

ActivityManager: Displayed com.android.myexample/.StartupTiming: +3s534ms (total +1m22s643ms)

adb logcat -b events -s am_activity_launch_time:I

但是这些度量都是基于显示的活动的第一帧。我的问题是,

  1. 无论如何,根据活动完成所有显示的时间来度量启动时间(例如,它需要另外15帧才能完整绘制窗口)
  2. 而且,还有一种方法可以测量指尖触摸图标的时间与时间系统感知并通过onCreate()响应的时间之间的时间间隔?

谢谢。

android automated-tests performance-testing
1个回答
0
投票
最好使用此代码。它将为您提供上次应用关闭时间。这可能对您有帮助。https://github.com/googlesamples/android-AppUsageStatistics
© www.soinside.com 2019 - 2024. All rights reserved.