Is there a way to attach new Android Profiler to debug app process directly after build?

后端 未结 2 521
抹茶落季
抹茶落季 2020-12-11 15:44

Attaching Android Studio 3.0 Android Profiler to debug app from cold start is almost impossible, because I\'d have to select process from dropdown (and start record) in very

相关标签:
2条回答
  • 2020-12-11 16:01

    With Android Studio 3.2 Canary 11, you can profile your app from startup.

    Just go to Run -> Edit Configurations -> Profiling Tab and check "Start recording a method trace on startup".

    Here's a link to download it. https://developer.android.com/studio/archive.html

    0 讨论(0)
  • 2020-12-11 16:17

    Well, makeshift solution because I didn't find anything better :

    I set breakpoint in Application onCreate to make sure cold boot stops on it. This gives me enough time to set up Android Profiler and select my process. However by starting app with debugger attached, the results might be bit skewed, because debugger slows down app a little.

    Seems to be the best option I have for now, but since nobody posted anything I missed, I'll try to do feature request on android tracker.

    0 讨论(0)
提交回复
热议问题