Xcode Instruments is stripping symbols despite all build settings to the contrary

前端 未结 7 2157
粉色の甜心
粉色の甜心 2021-02-05 17:05

Problem

Instruments\' Time Profiler is stripping all symbols except system libraries from my app, despite the fact that I have disabled this behavior in

相关标签:
7条回答
  • 2021-02-05 17:32

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

    0 讨论(0)
  • 2021-02-05 17:36

    I was finally able to get it to work by a method that's just shy of a nuke-and-pave scenario:

    1. 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.
    2. Delete the app from the iOS device.
    3. Restart the iOS device.
    4. Restart the Mac (I don't trust Xcode or Lion at all to quit all relevant processes otherwise).
    5. Launch Xcode, go to Organizer > Projects and delete Derived Data for the affected project.
    6. Clean your project. Hell, why not?
    7. Build and profile for Instruments.
    8. Choose the Time Profiler in Instruments for clarity.
    9. The first run will not show the symbols, but don't quit. Leave Instruments running!
    10. 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.
    11. 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.

    0 讨论(0)
  • 2021-02-05 17:39

    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.

    0 讨论(0)
  • 2021-02-05 17:40

    I have a lot of third party frameworks whose symbols and binaries are unfortunately getting lost.

    Additionally, my app's binary was getting lost.

    I.e. if I selected File > Symbols, clicked my target, and found the similarly named item, the Binary Path was showing up red.

    The solution was to go to Instruments > Preferences > Symbols, and add /Users/<MY_USER>/Library/Developer/Xcode/DerviedData to the search paths. Library is not indexed by Spotlight. After doing this, I have at least had the symbols for my app. The little circle next to my app's name goes from Yellow to Green when I do this, and persists between restarting Instruments, unlike other solutions to manually set the binary.

    Let me know if you can tell me how to get all the ones for my third party frameworks. I use Carthage for some, others installed manually. Have had no luck with these yet.

    0 讨论(0)
  • 2021-02-05 17:42

    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.

    0 讨论(0)
  • 2021-02-05 17:44

    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.

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