How to run upload symbols to upload dSYMs as a part of Xcode build process?

后端 未结 3 1126
失恋的感觉
失恋的感觉 2021-02-01 05:32

Ok, so I\'m trying to automatically upload dSYMs. I\'m following instructions from this official documentation: https://firebase.google.com/docs/crashlytics/get-deobfuscated-rep

相关标签:
3条回答
  • 2021-02-01 05:38

    TL;DR: dSYMS generated at build time has little value in the "bitcode enabled" era, you need to download dSYMs from Apple and upload them to your 3rd party crash reporter service as a post-build step after Apple has processed your upload.

    Background

    Symptom

    Missing dSYMs / failed symbolication in 3rd party crash reporting console. I thought despite following Crashlytics install instructions the script was failing.

    Bitcode - the fundamental issue

    Turns out the 3rd party crash-reporting systems (like Crashlytics, or New Relic) have a fundamental problem with the current best practice for app distribution, which is bitcode-enabled apps. Historically these 3rd party crash report systems relied on build-time steps to upload build-time generated dSYMs. But since bitcode-enabling means the app store recompiles your apps, your build-time generated dSYMs, that you are trying to upload, are effectively useless.

    As background, bitcode-enabled apps are "thinned" and thus re-compiled by Apple such that each device only gets the download bits it needs. You want to enable bitcode. It is a good thing. But, bitcode-enabled distribution messes up symbolication. No matter what dSYMs you generate at build time, the dSYMs won't actually correlate to crashes from App Store or TestFlight installed builds, as your crashes will be from App-store recompiled versions of your apps with new corresponding dSYMs.

    So don't worry about the upload script working or not at build time. In fact, that step could be removed from your build process as it is just wasting your time and bandwidth.

    The only case it might be useful is if you want to symbolicate crashes from locally-installed release versions instead of debugging them directly in Xcode.

    Solutions

    The solution is to wait "some time" (reportedly several minutes, via NewRelic documentation, in my experience a sleep of 120 seconds after fastlane upload but before I ran fastlane's download_dsyms action failed sometimes, a sleep of 300 seconds works reliably) after uploading your app (likely the duration of time the App Store says your build is "Processing"), then download the dSYMs from there and use your 3rd party crash reporters command-line upload script

    Manual download / upload

    The current recommended solutions from the 3rd party crash reporters (both NewRelic and Crashlytics documentation at least) is to either go to the App Store Connect page for the build and download dSYMs then upload, or using XCode's Organizer for the archive hit the "Download Debug Symbols" button, then upload them.

    This does work, with manual dSYM downloads pushed out to your crash reporting vendor you will get symbolicated reports. It is a manual process though using either the Xcode GUI or the App Store Connect interface.

    Fastlane automation

    You may automate the process with Fastlane though, which is I believe the proper solution.

    https://docs.fastlane.tools/actions/download_dsyms/#download_dsyms

    https://docs.fastlane.tools/actions/upload_symbols_to_crashlytics/

    0 讨论(0)
  • 2021-02-01 05:46

    You need to requred update in Project Target-> Build setting -> debug information (Debug and release both) -> DWARF with dSYM file

    0 讨论(0)
  • 2021-02-01 05:54

    Try the following steps:

    Step 1: Select your application's Xcode project, then your application target, then select "Build Phases".

    Step 2: In Xcode menu, select "Editor", then select "Add Build Phase", and then click on "Add Run Script Build Phase".

    Step 3: You should now see a Run Script section in your Build Phase options.

    Step 4: Paste in the script inside the body of the Run Script Build Phase.

    Keep in mind to set the right file-path(s) in your script(s).

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