问题
I am writing an iPad app and I would like to use Xcode Instruments to see if my app has any memory leaks. I have used Instruments successfully before but with Xcode 4.0.2 recently with this app I have the problem described in the title. It only works very rarely.
Steps to use Instruments: - From the Xcode menu: Product>Profile - Choose the Leaks instument - Watch Instruments start recording allocations and leaks while the app shows its splash screen. - The app's initial view controller becomes visible and Instruments stops recording at the same time.
Am I doing something wrong? Is this a bug in Instruments?
Any help would be appreciated.
Edit:
Instruments works on the iPad simulator but not the device (iPad 2)
回答1:
Have you tried changing the profile build from Release to Debug (go into "Edit Schemes" and you can change it there for Profiling)?
It could be something in the release build is causing Instruments to disconnect.
Also, pull up the device console in Organizer while it is running, and see if you see any messages related to the detachment.
回答2:
Be sure, you device is turned on (in some cases it can be spontaneously shut down).
来源:https://stackoverflow.com/questions/6686881/xcode-instruments-stops-recording-when-ipad-app-leaves-the-splash-screen