Mobile: stopPerfRecord freezes / hangs

I am using the Appium python client to profile an iOS application on an iPhone simulator. I am running the appium server with --relaxed-security.

This is what I have in my code before I launch the app on the simulator:

driver.execute_script("mobile: startPerfRecord", {
    "pid": "current",
    "profileName": "Time Profiler",
    "timeout": 60000
})

I am executing stopPerfRecord before I terminate the app again. I get the following error:

driver.execute_script("mobile: stopPerfRecord", {
    "profileName": "Time Profiler",
})

The process simply hangs forever, many minutes after the 60s timeout. I tried removing the timeout as well, or setting a much smaller value but it had no effect.

Any idea what I’m doing wrong?

What does the log say? If you could post as a git gist that would be ideal.

I’m not sure what to say about this. Everything I’ve ever read says don’t do this because your metrics will be inaccurate when compared to a real iPhone. Are you having the same problem with a real iPhone?

If you aren’t seeing anything in log, try adding capability: showXcodeLog set to true. Probably will give more insight into this particular problem.