Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2018.4.X, 2019.2.X, 2019.3.X



Found in



Issue ID




[iOS] Batchmode builds fail with CloudDiagnostics enabled when USYM_UPLOAD_AUTH_TOKEN is not set

Cloud Diagnostics


Internal repro:
./ --suite=integration --testtarget=iOS --testfilter=Unity.IntegrationTests.CrashReporting.CrashReportingBuildsTest.CanBuildiOS
The test enables CloudDiagnostics and performs a batchmode build. The resultant Xcode project won't compile with the error:
Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable.

Compiling the Xcode project by passing the env variable to xcodebuild process results in a successful build:
USYM_UPLOAD_AUTH_TOKEN=test xcodebuild build <projectPath>

To reproduce:

1. Download attached "" project and open in Unity
2. Change the platform to iOS
3. Enable Cloud Diagnostics
4. Close Unity Editor
5. Build in BatchMode with Arguments:

<Unity Path> -batchmode -buildTarget iOS -runTests -testplatform playmode -projectpath <PATH> -executeMethod BuildScript.UnityBuildTest -username <Your Unity ID> -password <Password of your Unity ID> -quit

6. When Build complete, open Xcode project
7. In Menu bar press Product > Build

Expected result: Xcode successfully Builds Project
Actual result: Xcode fails to Build Project and throws Error:

"Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable"

- This issue happens only on iOS
- If You Build directly from Unity Editor, everything works as Expected
- If You Build without "-runTests -testplatform playmode" or with Cloud Diagnostics disabled, the Build in Xcode completes without any issues
- The Project and a Video how to reproduce this issue are attached in Comments section
- There are few Forum links to this issue:

Reproduced on Unity 2018.4.1f1, 2018.4.3f1, 2019.1.9f1, 2019.2.0b8 and 2019.3.0a8
Not reproduced on Unity 2018.4.0f1
Regression on Unity 2018.4.1f1

Comments (28)

  1. A7fc77997f658076faebbc04c80afff3?d=mm


    Jun 30, 2020 02:57

    Still happening in Unity 2019.4.

  2. 19f8516b8d7ddeaba3a76e6c0e6f3f53?d=mm


    May 27, 2020 14:57

    Still reproduced

  3. 624eb24d6ae467a9abb49b25c8df7b98?d=mm


    May 23, 2020 21:21

    The issue is in 2019.3.13 and we used can get rid of it by adding a fake token but now even build directly via Xcode without using batch mode can still cause this problem. That only happens after we upgrade from 2019.2 to 2019.3.13. Please reopen this bug!

  4. 8a99dc2bd63af8a5ee33fc84b089449b?d=mm


    May 21, 2020 05:34

    Still reproduced in Unity2018.4.23f1

  5. C364bb5dceae6db8cb22d210a1f6f78b?d=mm


    May 20, 2020 21:07

    Just wanted to followup here after digging in a bit more: we too were able to resolve this by adding -username and -password arguments in 2019.3.0f6. Would be desired to have some sort of failure state on the build that described that when running a build in batchmode with these services enabled.

  6. C364bb5dceae6db8cb22d210a1f6f78b?d=mm


    May 20, 2020 12:21

    This is still occurring on 2019.3.14f1 -- we typically use jenkins for CI, but can even get this to reproduce if we simply run it as the main user on system.

  7. F9a7600692d6bd4ef09a9c40dcbc0781?d=mm


    May 07, 2020 16:17

    I just tested 2019.3.13f1 and I don't believe this is fixed? Does "fixed" mean "provide credentials on commandline so it's able to generate token" or "a way exist to leave Cloud Diagnostics ON but without uploading debug symbols".

    What revision was this actually fixed in?

    We're still having to disable crash reporting entirely or giving Unity an invalid token to work around htis.

  8. 874a412b8598c434369ca804bff3169e?d=mm


    Nov 07, 2019 06:41

    Reproduced on Unity 2018.4.12f1

  9. 758d43f45c352b11c6f75bede098447e?d=mm


    Sep 13, 2019 20:45

    Just tried to make a build on Unity 2019.2.5f1. Still had the same error.

    level=fatal msg="Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable"
    Command PhaseScriptExecution failed with a nonzero exit code

  10. C6aeb413c41dff31bb810eb0d9210b0a?d=mm


    Aug 20, 2019 08:50

    similar behaviour in 2019.2.0f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.