Fabric Crashlytics multiple environments for iOS app

不打扰是莪最后的温柔 提交于 2019-11-29 01:39:22

In attempt to get this working I did this:

  1. add custom user-defined setting to the Build Settings, e.g. MY_CRASHLYTICS_API_KEY and MY_CRASHLYTICS_BUILD_SECRET
  2. replace concrete APIKey in Info.plist under Fabric group with ${MY_CRASHLYTICS_API_KEY}
  3. add respective API Keys and Build Secrets from organisations you have created per the environment to Build Settings under the key from Step 1
  4. change the script in Run Script phase to be something like the below
  5. configure apps via Crashlytics Mac widget. This is not an easy part too. Apps are added to your organisations only when they are running with Debug configuration. The reason is the app should stay for a while up and running, so Crashlytics could track it down. This required me to change Api Keys and Build Secrets for both, the script and the Build Settings key and get the app registered. After that I was able to change Info.plist to use the environment var from build settings.

The run script:

echo "Running Crashlytics (${CONFIGURATION})"
"${PODS_ROOT}/Fabric/Fabric.framework/run" ${MY_CRASHLYTICS_API_KEY} ${MY_CRASHLYTICS_BUILD_SECRET}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!