Xcode's Profiler does not show Symbol names
Asked Answered
A

10

27

Updated to xCode 4.5 and when time profiling my app Symbol Name doesn't show classes or objects anymore, but shows memory addresses see below.

0x2fd42e13
0x38014448

I used to see the following

main
NSManagedObjectContext

When I could see the class names then I can track down the issues in the extended detail. Now the extended detail shows the same thing as the 0x2fd42e13.

Anabolite answered 26/9, 2012 at 21:32 Comment(2)
guessing - clean the project and try again?Hamfurd
Yeah, tried that first thing.Anabolite
A
17

Solved it myself:

Edit your scheme where it says "WhateverProjectNameIs>iPad 6.0 simulator"

Then click on "Profile" on the left On the Info tab, change Build Configuration to Debug (probably set to Release) That should do it. Note that for whatever reason, the build target is not set to the same build configuration as the profile target and this has tripped me up more than a time or two.

Anabolite answered 27/9, 2012 at 1:10 Comment(4)
I tried changing Build Configuration to Debug but it's still not working. Do you have any other thoughts?Unamuno
Try closing xcode, clean project and go back to see if the build config switched back or not?Anabolite
Bah! I had so much hope for this answer, but no joy. <sigh>Amr
It's perfectly fine to use Instruments with Release build configurationXhosa
B
43

To resolve my issue I had to tell Instruments where my binary was as it had lost track of it for some reason.

1. Run Instruments as you normally would to get the masked data.

enter image description here

2. In the Project Navigator, expand the Products folder and click your application (either provider (.appex) or application (.app). If your File Inspector is not visible, right click the application and click "Show File Inspector"

enter image description here

3. On the right side of your screen you should now see the file inspector for your binary. Opposite click on the "Full Path" property and click "Copy".

enter image description here

4. Go back into Instruments and go to File->Symbols

enter image description here

5. Drop down your application or provider on the left and click on the item with the dot next to it (it should have the same name as your application)

enter image description here

6. You'll notice that the Binary Path is red. This means that Instruments has lost track of your binary file. Click the small folder icon on the bottom right to bring up a Select File dialog. Press Command+Shift+G to enter a directory path, and paste the path that we copied from xcode earlier.

enter image description here

7. You should now have the binary selected, click Open to open it. Click done on the Dialog to close the windows. Instruments should now show the proper details and symbol names while profiling your code.

enter image description here

  1. If this reoccurs, and your binary is located at a path like /Users/<User>/Library/Developer/Xcode/DerivedData/..., you will need to add this to your default search path in Instruments. /Library is not indexed by Spotlight, so is not searched for by Instruments. Go to Instruments > Preferences > Symbols, and add /Users/<User>/Library/Developer/Xcode/DerivedData/.
Bracknell answered 14/5, 2017 at 17:46 Comment(5)
Step 2: Drop down the products folder. What exactly does that mean and how do you do that?Galibi
@Galibi on the left side of xcode, you should have a "Project Navigator" that lists all of the files in your project. If you don't see it, check the top right of your xcode window. There should be three bottons, one for each panel. Click the left button to enable the left panel and click the folder icon in the left panel. If you click the arrow to drop down your project, you should see a folder called "Products", drop that down and you will see your two binaries.Bracknell
Glad this was clarified in the comments! I was really confused at that step as well.Herwin
Added an extra step that makes this fix more permanent. Without it, Instruments was unable to find my binary any time I updated my app.Herwin
Thanks for this was driving me nuts! I had to use the Release-iphoneos path instead of Debug-iphoneos path at stage 6 to get this to work (i.e. DerivedData/MyApp-blablablablabla/Build/Products/Release-iphoneos/MyApp.app/MyApp). Apparently the default setting for profiling is release mode developer.apple.com/forums/thread/23815Hartwell
A
17

Solved it myself:

Edit your scheme where it says "WhateverProjectNameIs>iPad 6.0 simulator"

Then click on "Profile" on the left On the Info tab, change Build Configuration to Debug (probably set to Release) That should do it. Note that for whatever reason, the build target is not set to the same build configuration as the profile target and this has tripped me up more than a time or two.

Anabolite answered 27/9, 2012 at 1:10 Comment(4)
I tried changing Build Configuration to Debug but it's still not working. Do you have any other thoughts?Unamuno
Try closing xcode, clean project and go back to see if the build config switched back or not?Anabolite
Bah! I had so much hope for this answer, but no joy. <sigh>Amr
It's perfectly fine to use Instruments with Release build configurationXhosa
U
2

Profiling the debug configuration will not give you correct profile values. The debug configuration is not compiled for speed, and all your NSLog statements are still in.

I created a "Profile" build configuration to deal with this issue. See my answer to a similar Stackoverflow question.

Unemployed answered 23/11, 2012 at 12:33 Comment(0)
B
2

Me too had the same issue and I tried all steps that others suggested. But none of them fixed the issue for me. So, what I did is, I just opened the Instruments and next to the Record button, click on the drop down menu and select the target using Choose target option. Then click on Record button, now I could see all the methods in the instruments panel :)

Broadbent answered 18/2, 2013 at 11:8 Comment(0)
S
2

I know this is an old question, but none of the solutions mentioned above worked for me. I need to switch to the latest iOS simulator (use iOS 9 instead of iOS 8 currently) to show symbol name correctly. I think Xcode Instruments can only work with simulator which run latest iOS SDK.

Sauer answered 5/2, 2016 at 13:12 Comment(0)
D
2

Restart Instruments and Xcode solved my problem :(

Dissipated answered 15/4, 2016 at 9:16 Comment(0)
M
1

I was the having same problem and tried the other solutions to no avail. The Scheme issue is usually the problem, so I started there. But in my case it was already configured properly. Here's what finally worked for me:

  • In Instruments, stop the process if it's running.
  • Go to File -> Symbols, and under dSYM path, find the library that isn't being symbolicated.
  • In my case, it was pointing to items in the Trash. So I emptied the Trash, deleted the Module Cache and project in the Derived Data folder, and when I rebuilt the project it started working again. In your case it could be pointing to some other file that either doesn't exist or isn't reachable by Instruments.
Moreville answered 1/2, 2016 at 20:2 Comment(0)
M
0

Reset the build path to default. I have changed it to tmp/ folder previously and symbol can't show the code. After reset this path and profiler can show the code correct. Build Path(Relative to Derived Data) setting as bellow: Build Path

Metalinguistics answered 26/3, 2017 at 7:19 Comment(0)
U
0

I have same problem in Xcode 11.4 1. Show your YOUR_PROJECT.app folder in Xcode while build success , find Release-iphoneos or Debug-iphoneos folder, select which on determined by your Profile`s build setting. normally we choice Release-iphoneos. 2. Add that path to Instruments in 【Preferences】->【Symbols】 to search YOUR_PROJECT.app.dSYM file.

enter image description here

Ugo answered 22/4, 2020 at 12:11 Comment(0)
M
0

An Xcode restart fixed it for me, on Xcode 13.3.

Moneylender answered 28/3, 2022 at 23:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.