Xcode Instruments is stripping symbols despite all build settings to the contrary
Instruments’ Time Profiler is stripping all symbols except system libraries from my app, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but only on one development machine. The other dev machine behaves normally.
Instruments’ Time Profiler is stripping all symbols except system libraries, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but this is only happening on one of my development machines. I have two development machines running the same version of OS X, Xcode, and Instruments, and each machine is using an identical copy of the same Xcode project with identical build settings, schemes, and other configurations, and the app is profiled using the same test device (iPhone 4S with the latest public version of iOS 5).
– Mac OS X 10.7.4
– Xcode 4.3.2 (4E2002)
– Instruments 4.3 (4321)
– Mac OS X 10.7.4
– Xcode 4.3.2 (4E2002)
– Instruments 4.3 (4321)
Steps To Reproduce
- Open included sample project on each machine.
- Make sure the iPhone 4S is selected as the test device.
- Select Product > Profile
- When Instruments launches, select Time Profiler and continue.
- Run the app.
- Notice how the symbols are stripped when running on the iMac (Machine 1) but not on the MacBook Air (Machine 2).
Symbols from my own code should appear in the Time Profiler on both machines.
I have tried all of the following, with no change in the actual results:
Rebooting the machine.
Trying other Xcode projects
Deleting the “Derived Data” for all projects in the Xcode Organizer.
Re-symbolicating the document in Instruments (carefully selecting the correct DSYM file in ~/Library/blahBlahBlah…)
Here is a link to a .zip file of a sample project: Sample Project .zip
- What does <non-object> in Allocation “heapshots” mean?
- Enable and Debug Zombie objects in iOS using Xcode 5.1.1
- How can I get rid of resident dirty memory in Objective-C?
- Inspecting memory allocation,leaks using Instruments tool
- What is “dirty” memory in Instruments?
- How to run iPhone program with Zombies instrument?
6 Solutions Collect From Internet About “Xcode Instruments is stripping symbols despite all build settings to the contrary”
I was finally able to get it to work by a method that’s just shy of a nuke-and-pave scenario:
- Make absolutely sure all symbol stripping is disabled for your current build configuration. Make sure you’ve done this for your Release config if that’s what’s being profiled for Instruments.
- Delete the app from the iOS device.
- Restart the iOS device.
- Restart the Mac (I don’t trust Xcode or Lion at all to quit all relevant processes otherwise).
- Launch Xcode, go to Organizer > Projects and delete Derived Data for the affected project.
- Clean your project. Hell, why not?
- Build and profile for Instruments.
- Choose the Time Profiler in Instruments for clarity.
- The first run will not show the symbols, but don’t quit. Leave Instruments running!
- Re-symbolicate the document in Instruments, navigating carefully to the correct dSYM file for the current build. This should be easier since you’ve deleted the derived data in step 5.
- Now you should be able to see your symbols. It helps if you hide non-objective-C symbols.
Why do I suggest that you delete the app and restart the iOS device in Steps 2 and 3? I have a suspicion that Xcode doesn’t perform a clean installation of each build, but may install deltas, such that the symbol addresses present in Instruments are a mixture of the current build plus previous builds. If so, then this issue is even more common for someone like me, who shares a single test device between more than one Mac. This assumption could be wildly incorrect.
If the above steps don’t work for you, please let me know in the comments. I’d like to create a detailed radar report at some point in the future.
I’m not sure that it has been fixed in the 4.3 but this is a known problem in 4.2 seen here
There is a known issue with the Profile action from Xcode 4.2. After a build in which no source files have changed, Instruments will be unable to gather symbols for the target application.
This affects projects where both:
- The Release configuration is selected for the Profile action.
- The Strip Linked Product build setting is set to “Yes”, or
a custom Run Script build phase strips the product. (non-default)
The workaround is to do any one of the following:
- Perform a “Clean” on the product before initiating the Profile
- Do a Clean of the product and temporarily set the Strip Linked
Product build setting to “No” while Profiling.
- Set the configuration of the Profile action to Debug.
- Run successive profiles directly from within Instruments when you do
not need to rebuild. When developing Mac apps, using the GC Monitor
template in Instruments may cause Instruments to crash. To
workaround the problem please consider migrating your application to
I’ve had a similar problem for days. I was able to profile the Debug configuration, but not Release. First I tried to make a copy of the release configuration (as suggested somewhere on the web), but that copy did not work either.
Then I made a copy of Debug, called it Profile, tried it and the symbols of Profile were shown in the profiler. Great! I then changed the optimization levels etc. to the same as Release, and now it works! Just wanted to share this, as this comment would have spared me hours…
Have been facing the same and stumbled upon this thread.
I realized that I first profiled the app with release build and after changing the scheme in Xcode for the same app, the profiler was still unable to symbolize. I have tried all obvious solutions you mentioned above but in vain.
The profiler somehow is still referring to the first build (release build)’s settings and hence it is not able to symbolize. So, I just changed the app’s bundle identifier for testing purpose so that a new app is created altogether for profiling purpose. I could check the code where leaks exist now.
Try it out and let me know if this works for you too. Still pondering over why Instruments is failing to symbolize though.
I had a similar issue where I had no symbols in my os x application that I built from the command line (so in this case it is not an iphone or xcode issue). It turned out the problem was due to a bad DYLD_LIBRARY_PATH that contained my PATH. When I got rid of all those non-library paths, such as /usr/bin/, it worked.
Try open XCode 3 and him Organizer. And try add from this Organizer a devices to both machines.
Just open Organizer and wait him processes. If you’re see a button “Use for development” then click him.
Sometimes, XCode 4 can’t add a device a truely for full development.
- What advantage(s) does dispatch_sync have over @synchronized?
- NSPredicate: filtering objects by day of NSDate property
- Objective-C: self = nil doesn't set instance to null value
- Remove tab bar item text, show only image
- NSNetService works fine, but can't get hostName, resolve causes error
- Calling C++ from Swift – what is the equivalent of std::vector<T>
- UNNotificationAttachment with UIImage or Remote URL
- Updating UIImage orientation metaData?
- swift function calls: self-keyword vs without
- Debugger lldb says my object is nil when is not ?
- Programmatically detect which app store the app was downloaded from
- Swift 3 – Extract JSON data
- CSS background images resizing incorrectly on iPad and iPhone.
- 'Cordova/CDVViewController.h' file not found when run in Xcode terminal
- email from Apple – “Missing Push Notification Entitlement”