How do you start the app with the profiler in "trace java methods" mode?

1.2k Views Asked by At

We are ready to optimise app startup time.

The ultimate goal is to, quote

cold start into fragment X as quickly as the calculator is starting up

I do have a few ideas on what we could tweak to try and speed up loading, but I'd like to verify them before bothering to try them out.

So I open the profiler view and hit the app launch configuration.

profiler without call chart

Ok ... no trace.

Unfortunately, I cannot hit the record button until after the app has loaded. Which doesn't do me any good because I'm trying to get a profile of the startup.

Any way I can launch with the record feature already active?

UPDATE

Yes, you can if you edit the run configuration, buuuut that's not giving you any relevant information because even then, it only starts recording the information AFTER the startup.

enter image description here

1

There are 1 best solutions below

0
On

To enable advanced profiling, follow these steps:

  • Select Run > Edit Configurations.
  • Select your app module in the left pane.
  • Click the Profiling tab, and then check Enable advanced profiling for older devices.
  • Select Run > Profiler.

This will start the app and start recording immediately, you only need to hit stop recording once you want.