Last active
May 18, 2018 19:25
-
-
Save capyvara/5230032 to your computer and use it in GitHub Desktop.
Process the Unity generated Xcode project to allow dSYM generation on Release but keeping the distribution size the same, only tested in a clean generated project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adjust dSYM generation | |
var xcodeProjectPath = Path.Combine(xcodeProjectDir, "Unity-iPhone.xcodeproj"); | |
var pbxPath = Path.Combine(xcodeProjectPath, "project.pbxproj"); | |
var sb = new System.Text.StringBuilder(); | |
var xcodeProjectLines = File.ReadAllLines(pbxPath); | |
foreach (var line in xcodeProjectLines) | |
{ | |
// Remove from OTHER_LDFLAGS | |
if (line.Contains("-Wl,-S,-x")) | |
continue; | |
// iOS Default when not present is dwarf-with-dsym | |
if (line.Contains("DEBUG_INFORMATION_FORMAT")) | |
{ | |
// Replace line to stripping on postprocess deployment flags | |
sb.AppendLine("\t\t\t\tDEPLOYMENT_POSTPROCESSING = YES;"); | |
sb.AppendLine("\t\t\t\tSEPARATE_STRIP = YES;"); | |
sb.AppendLine("\t\t\t\tSTRIP_INSTALLED_PRODUCT = YES;"); | |
continue; | |
} | |
// Defaults to Yes | |
if (line.Contains("COPY_PHASE_STRIP")) | |
continue; | |
// Defaults to Yes | |
if (line.Contains("GCC_GENERATE_DEBUGGING_SYMBOLS")) | |
continue; | |
sb.AppendLine(line); | |
} | |
File.WriteAllText(pbxPath, sb.ToString()); |
Thanks a lot dude! That saved my life. S2
I forked this and wrapped it in a build post-processor. Just drop https://gist.github.com/tenpn/f8da1b7df7352a1d50ff into your project and future builds will have crash info enabled.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for posting this, very useful.