Register App for Symbolication in XCode Profiler

前端 未结 6 1697
猫巷女王i
猫巷女王i 2021-02-04 03:00

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]

相关标签:
6条回答
  • 2021-02-04 03:02

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

    0 讨论(0)
  • 2021-02-04 03:11

    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.

    0 讨论(0)
  • 2021-02-04 03:11

    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.

    0 讨论(0)
  • 2021-02-04 03:21

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

    0 讨论(0)
  • 2021-02-04 03:22

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

    0 讨论(0)
  • 2021-02-04 03:25

    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.

    0 讨论(0)
提交回复
热议问题