20

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

Community
  • 1
  • 1
bendytree
  • 13,095
  • 11
  • 75
  • 91
  • I just noticed your error: "Re-symbolication requires MyAppName.app.dSYM and AppleA5AE2 to have matching UUIDS" – Nandeep Mali Sep 19 '12 at 05:29
  • This happens when you have selected another application from that list and choose a .dSYM file for your application. I still don't know what is the issue in your case but just thought I would mention it here. For example, try it with 'Accelerate' app and you get this: https://dl.dropbox.com/u/8307930/uuid.png (My app being "MultiVideoPlay". – Nandeep Mali Sep 19 '12 at 05:37
  • Also, is this happening for all apps or just this one? Try creating a sample project and see if that runs fine. – Nandeep Mali Sep 19 '12 at 06:22

6 Answers6

12

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.

Dav Yaginuma
  • 691
  • 7
  • 14
9

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).

Community
  • 1
  • 1
fishinear
  • 6,101
  • 3
  • 36
  • 84
2

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).

Rob Napier
  • 286,113
  • 34
  • 456
  • 610
  • If I am on the "Binaries" tab & press "Locate", it seems to be trying to locate the Binary that is selected in the list. I say this because if I choose my dSYM anyways then an error pops up, "Unable to use selected symbols - Re-symbolication requires MyAppName.app.dSYM and AppleA5AE2 to have matching UUIDS. – bendytree Aug 31 '12 at 14:41
  • If I move to the "Paths" tab & add my directory, it has no effect and when I re-open the symbolicate dialog it is no longer there. – bendytree Aug 31 '12 at 14:43
  • I added `.../DerivedData` through Instrument's preferences, but it has not had any effect. – bendytree Aug 31 '12 at 14:50
  • I wasn't suggesting to hit Locate. I was saying just hit "Symbolicate" after adding the search path. Did you try that? – Rob Napier Aug 31 '12 at 15:01
  • I did hit Symbolicate after adding the search path, but no luck. Thanks though – bendytree Aug 31 '12 at 15:02
  • How do I open ~/Library/... from within Instruments? It's hidden from Instruments, but I can see it in Finder. – Fredrik Johansson Nov 19 '12 at 15:00
  • Cmd-Shift-G will let you go anywhere you want in a file-picker. You can also find a directory in Finder and drag it to the file-picker. That will cause the file-picker to change to that directory. – Rob Napier Nov 19 '12 at 17:39
1

This also depends on where XCode is putting your build. You can select "MyCoolApp.app" in the XCode project organizer, right or control-click for "Show in Finder". Not all project settings will put it in DerivedData (several different project settings can conspire to put it in different locations). Now that you've found where XCode is depositing your builds, you can try adding it to Instruments from there using the steps previously outlined. When the File dialog comes up from clicking "Locate...", you can just drop the .app from the Finder on the File dialog and it will go to that directory.

quellish
  • 21,123
  • 4
  • 76
  • 83
1

If you change the code signing identity for your "Release" build configuration from "Automatic Profile Selector: iPhone Distribution" to "Automatic Profile Selector: iPhone Development" (emphasis mine) then your app's binary will be listed in Instrument's Re-Symbolicate sheet and you can point it at your Derived Data folder.

edelaney05
  • 6,822
  • 6
  • 41
  • 65
0

No success with above mentioned. What worked for me with Xcode 5:

  • Get location of your product as described in quellish's answer. Ex.

    /Users/ME/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos /Users/ME/Library/Developer/Xcode/DerivedData/Build/Products/Release-iphoneos

  • Open Instruments Preferences and add the location(s) in "dSYMs And Paths".

Schoob
  • 1,688
  • 1
  • 14
  • 18