8
votes

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)

2

2 Answers

13
votes

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.

0
votes

Be sure, you device is turned on (in some cases it can be spontaneously shut down).