问题
I'm developing a custom keyboard but it's very slow and sometimes it's crashing.
Because I'm not sure where it comes from, I'd like to Time Profiler with Instruments. But when I select MyIphone > Keyboard Extension (target), I get:
Target failed to run
or
Waiting for x.x.x.Keyboard
Please take appropriate action to initiate the launch of 'x.x.x.Keyboard.'
Is it even possible to use Instruments with an app extension? If yes, how should I proceed?
回答1:
I can't use Instruments to analyze my keyboard before, however my method might be helpful to you.
- Run the project on your iPhone.
- Xcode the left column, the seventh button 'Show the Debug navigator', select the 'Memory' column.
- In the right 'Memory Report', select 'Profile in Instruments' in the upper right corner. Instruments will open.
I used this method to enter the Instruments tool to analyze the memory. I noticed that the software name displayed on the Instruments tool was followed by a number, like com.xxx.xxx.keyboard (4489)
.
Accessing Instruments directly from Xcode->Product->Profile
does not work properly. This may be the key.
Hope this helps you.
来源:https://stackoverflow.com/questions/47513051/run-xcode-instruments-on-device-with-a-ios-keyboard-extension