use instruments - leaks with a device

IosMemory LeaksInstrumentsMemory Leak-Detector

Ios Problem Overview


I'm starting to use Instruments-Leaks with an iPhone 3G. When I try to run the app with Instruments on the iPhone I obtain

Target failed to run: Remote exception encountered: 'Failed to get task for pid 280'

Ideas?

The only time I succeed in running the app with instruments it run very slow, I couldn't test it. What are the steps to run the app on the device searching for leaks?

Ios Solutions


Solution 1 - Ios

The solution for me was to make sure that my Profile scheme was using the "debug" and not "release" build configuration.

In Xcode 4 select Product/Edit Scheme from the top menu then click on the "profile" button on the left. On the "info" pane you will see a setting for Build Configuration- set that to "debug"

Solution 2 - Ios

This error is also thrown if you are trying to test your app on a device with a distribution profile selected. Make sure you have the correct code-sign settings for development.

Solution 3 - Ios

You CAN profile the release build on the device. What you have to do is build the release build with a developer certificate. See here.

Solution 4 - Ios

Instruments basically does its work by becoming the debugger for the app. If you can't run Xcode's debugger against it, then you can't run Instruments against it.

Mostly, entitlements need to be set to allow debugging.

Sometimes after using XCode to debug apps, I find I can't use Instruments until I reboot the device.

Unlike XCode, Instruments can be confused between two apps with the same name, but different bundle IDs. (Or perhaps same name and similar bundle IDs.) When I have multiple versions of an app on a device, I often have to delete the extra to get Instruments to connect to the correct app. If you have one debug build and one release build, this could be the problem.

So, delete any duplicates of your app and restart the device. (You could change the display name for release and debug build configurations.)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSefran2View Question on Stackoverflow
Solution 1 - IosPeter JohnsonView Answer on Stackoverflow
Solution 2 - IosrectWareView Answer on Stackoverflow
Solution 3 - IosWilliam JockuschView Answer on Stackoverflow
Solution 4 - IosWalt SellersView Answer on Stackoverflow