我正在阅读这篇关于在您的 android 应用程序上运行 traceview 的文章:https ://developer.android.com/studio/profile/traceview.html我假设他们正在谈论的模拟器是 android 模拟器,而不是 Genymotion 模拟器是我正在使用的那个。
它说要将跟踪文件从模拟器中拉出到您的主机上,您只需运行以下命令:
adb pull /sdcard/startup.trace /tmp
我在我的 Genymotion 模拟器上运行它,但找不到该文件。然后,我使用 Android 设备监视器在设备内部查找文件,但在该位置没有保存名为 startup.trace 的文件。
我在我的代码中这样做了:
public class MyApplication extends MultiDexApplication {
public void onCreate() {
super.onCreate();
Debug.startMethodTracing("startup");
}
}
然后我在我的活动 onResume 方法中停止跟踪以测量我的应用程序的启动时间:
@Override
protected void onResume() {
super.onResume();
Debug.stopMethodTracing();
}
我希望 traceview 测量我的启动时间,但不知道文件在 Genymotion 模拟器上的保存位置。任何人都可以帮助我保存文件的位置吗?