Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register App for Symbolication in XCode Profiler

I'm trying to run XCode's time profiler on my app that is running on my device, but the symbol names show up like 0x2fe26643 instead of [MyClass myMethod]. I realize I need to re-symbolicate the app, but I don't know how.

A few answers like this and this say to press "Re-Symbolicate", find your binary in the list, then press "Locate" to find the dSYM manually. My app is not in the list called dSYM Locations:

enter image description here

How I can get my results symbolicated?

UPDATE: I posted a YouTube clip of what it looks like when I try to re-symbolicate: http://www.youtube.com/watch?v=CcLGRNkmako

like image 777
bendytree Avatar asked Aug 31 '12 01:08

bendytree


3 Answers

I was having this same problem when trying to profile my app on device (worked fine in simulator). When trying to re-symbolicate, my app binary was not showing up at all under the "dSYM Locations" dialog list, so I wasn't able to select it and then use the Locate button to associate the appropriate dSYM as other answers have suggested.

I was able to get symbolication back in the device profiling by going to Edit Scheme in Xcode and changing the Profile build to Debug instead of Release.

like image 183
Dav Yaginuma Avatar answered Nov 14 '22 08:11

Dav Yaginuma


Here is what I did to enable profiling, without switching to debug mode. This is for Xcode 4.5.1

  1. Create a new "Profile" build configuration, based on the existing "Release" configuration: Select the project in the project navigator to open the project editor. Select the project in the project editor and click the Info button. Expand the Configurations section in the Info pane and click the Add (+) button at the bottom of the section. Select the existing "Release" configuration from the pop-up menu as a starting point for the new configuration. Select the name of the copy and type "Profile". See more in the Xcode User Guide.

  2. Set the Code Signing Identity of the "Profile" configuration to "iPhone Developer" (or the same as your "Debug" configuration): Click the Build Settings button to display the build settings for the project. To change the build settings in the new configuration for all the targets in the project, edit them at the project level. To change the build settings for an individual target, select that target. If you edit them at the project level, make sure that you double-check the target level afterwards: target settings override project settings. The Code Signing Identity is in the "Code Signing" section.

  3. Make sure that the "Generate Debug Symbols" setting is YES for the "Profile" configuration. It was already YES in my case.

  4. Set your new "Profile" configuration to be used by the "Profile" scheme: Select "Product->Edit Scheme" from the menu, select the "Profile appname.app" tab at the left, and then select the "Profile" under "Build Configuration".

  5. In your appname.entitlements file set the "get-task-allow" property to YES.

  6. Press the ALT key, and select "Product->Clean Build Folder" from the menu.

  7. Now select "Product->Profile" from the menu, and you should be good to go.

All kinds of strange things can happen if you don't do all of this. I have had no symbols show up at all, or only library symbols show up. I have had symbols only showing up if you first do a debug build, and then profile afterwards (which means the symbols are probably incorrectly taken from the debug build). I have had the profiler complaining about UUID mismatch, and I have had the infamous "Entitlements do not match" error (see more on that here).

like image 9
fishinear Avatar answered Nov 14 '22 09:11

fishinear


They mean to press the "Locate" button and then find your app in ~/Library/Developer/Xcode/DerivedData. I've found, however, that the following seems to work:

  • Preferences > Search Paths
  • Add ~/Library/Developer/Xcode/DerivedData (I actually have this as /Users/rnapier/..., so I'm not certain if ~ works)

This still doesn't always auto-symbolicate for me. But it lets me use File>Re-Symbolicate Document, and then just hit the "Symbolicate" button and it's been working for me. The fact that this doesn't work "out of the box" is insane....

I recommend duping radr://10158512 (which is itself a duplicate of 10015727, but that one isn't in openradar).

like image 2
Rob Napier Avatar answered Nov 14 '22 09:11

Rob Napier