Why does recompiling from bitcode make me unable to symbolicate in Xcode ad hoc releases and how do I fix it?
Asked Answered
G

1

11

So this has be driving me nuts but I finally found out that the bitcode compile option when I export my app for adhoc deployment is causing my debug symbol file (dSYM) and my app UUID to mismatch meaning I cannot symbolicate any crash logs.

Turning off the option fixes this but is there a way I can have it be fixed with the option on? I read the tip for that option and it says the store uses this method. Will I be unable to read crash logs from the app store now too or is this just a local problem?

Here is what I get from an old build before this Xcode version:

dwarfdump --uuid app
DD25E6C9-... (armv7)
29F74B2E-... (arm64)

dwarfdump --uuid app.dsym
DD25E6C9... (armv7)
29F74B2E... (arm64)

Fine. Now with bitcode on:

dwarfdump --uuid app
E7D2BE71-... (armv7)
5C871FD7-... (arm64)

dwarfdump --uuid app.dsym
BC93BCF5-... (armv7)
3312658C... (arm64)

Obviously it won't symbolicate. I have tried it with the option off and it matches again. Is this a problem with Xcode not regenerating symbols for the new bitcode build? And why oh why does this default to ON and not warn you about your crash logs??

Griddlecake answered 18/12, 2015 at 20:31 Comment(1)
In Organizer in Xcode there is a "Download dSYMs" option that is supposed to download the dSYMs for the binaries Apple builds to the xcarchive. However, for me the dSYM for the binary still ends up missing, maybe you will have better luck.Zandrazandt
B
6

When bitcode is enabled, XCode archiving process produces: 1. Native arm64 or armv7 code 2. Bitcode 3. dSYM file (matches the UUID of the native code)

When you generate an ad-hoc distribution and enable the "bitcode compile" option, XCode recompiles Bitcode into Native as well, which might and usually does result in a different UUIDs for the arm64 and armv7 parts. The original app.dSYM is not touched (and thus doesn't match the new binaries), instead new dSYMs are being generated in the same xcarchive folder, they have the form of "E2015333-1220-391E-928C-04C32A179EC9.dSYM" and match the actual UUIDs of the newly compiled binaries.

The story doesn't always end there, these new dSYM files might be obfuscated (i.e have __hidden#232434 instead of the actual symbol names). The mappings to deobfuscate them also reside in the xcarchive folder in a folder names "BCSymbolMaps".

To de-obfuscate such a dSYM one would use the following command:

dsymutil --symbol-map <bcSymbol-file> <obfuscated-dsym-file>
Beverlybevers answered 23/11, 2017 at 0:11 Comment(2)
How to use this? Can you add more details?Demasculinize
Have you found an answer? The dSYM files have different names than the bcSymbol files in my case, so I don't know how to map them to each other.Suzisuzie

© 2022 - 2024 — McMap. All rights reserved.