Symptoms
- Profiling a Unity app in the XCode profiler Instruments does not show symbols.
- I have built the app with dSYM enabled, but it does not show the symbols correctly.
- I already run Instruments with symbols, but suddenly the symbols vanished.
Cause
Starting Instruments, or restarting a session, does not show symbols for user code although the solution is built with dSYM.
Resolution
Symbols are useful to identify the function responsible for allocations or crashes. You need to build your app with symbols (stored in dSYM file) to show function names instead of cryptic memory addresses during profiling. This will guide you through building a Unity project and profiling it via Xcode/Instruments. This is useful if you want to profile time spent in various methods, or if you want to see some allocations that Unity profiler might fail to catch for some reason.
Unity:
Build iOS Development Build from Unity (Shift + Command + B)Xcode:
Stop Running App if applicable (Command + .)Xcode:
Clean Product (Shift + Command + K)Xcode:
Build Product (Command + B)Xcode:
Open Log Navigator (Command + 7) to find your projects.app.dSYM
path.*
Log:
Find entry for GeneratingProductName.app.dSYM
.Log:
Click the icon on right side of entry for more info.Log:
Memorise the.app.dSYM
path.
Path:
Will be similar to/Users/YourUserName/Library/Developer/Xcode/DerivedData/Unity-iPhone-bqqxaseotmttydgblyqetnfdzqtg/Build/Products/<mode>-iOS/YourProjectName.app.dSYM
Xcode:
Open Profiler (Command + I) of choice.
Example:
Choose Allocations.Example:
Stop Trace (Command + R) after some time.
Profiler:
Re-Symbolicate Document to get Symbols if needed.
dSYM:
In the top menu, go to File/Re-Symbolicate Document...dSYM:
Enter your Binary name in Search box.
Note:
This is your Unity project name.
dSYM:
Locate.app.dSYM
for your Binary.
Locate:
Select your Binary and press LocateLocate:
Browse to your.app.dSYM
and press Open.Locate:
If you get error here about UUID, do a clean/rebuild.
dSYM:
Press Symbolicate.
Profiler:
Your profiler should now have useful information and correct symbols.
*alternatively you can use the Project Explorer to find the dSYM file by clicking onto the Derived Data arrow and go to Products/<Mode>-iphoneos/.
If you want to symbolicate crash logs you can read about it here.
More Information
This article applies to Unity versions 4.6.0f1 and higher, Xcode 6 and higher, iOS 6.0 and higher