Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Customize Xcode build settings for archive export

Discussion in 'Unity Build Automation' started by keren_unity, Sep 6, 2022.

  1. keren_unity

    keren_unity

    Joined:
    May 23, 2022
    Posts:
    5
    Current: When running Unity Cloud Build for iOS and generating the Xcode archive (XCArchive file), the logs document this command being run:

    Code (csharp):
    1. set -o pipefail && xcodebuild -scheme Unity-iPhone -project ./Unity-iPhone.xcodeproj -configuration Release -destination 'generic/platform=iOS' -archivePath /BUILD_PATH/Library/Developer/Xcode/Archives/2022-09-06/build\ 2022-09-06\ 12.52.58.xcarchive -UseModernBuildSystem=YES clean archive CODE_SIGN_IDENTITY=Apple\ Distribution:<distribution_redacted> | tee /BUILD_PATH/Library/Logs/gym/Kaonashi.Dev-Unity-iPhone.log | xcpretty  --no-color
    The most important piece to note in that command is that it is using
    UnityiPhone
    as the scheme.

    Desired Outcome: We are actually needing to use the
    UnityFramework
    scheme instead of the default
    UnityiPhone
    scheme since this Unity project is getting used as a Framework within another project.

    Question: How can I customize the
    xcodebuild
    command that is getting run by UCB to set the scheme to
    UnityFramework
    instead?

    What I've tried: With some guidance from this post, I added a
    fastlane.json
    file that points to a
    Gymfile
    that looks like this:

    Gymfile
    Code (CSharp):
    1. scheme "UnityFramework"
    However, UCB doesn't seem to be picking up on that setting when running the
    xcodebuild
    command.
     
  2. keren_unity

    keren_unity

    Joined:
    May 23, 2022
    Posts:
    5
    So I got a new error that looks like this:

    Code (CSharp):
    1. Couldn't find specified scheme 'UnityFramework'. Please make sure that the scheme is shared, see [URL]https://developer.apple.com/library/content/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/ConfigureBots.html#//apple_ref/doc/uid/TP40013292-CH9-SW3[/URL]
    And while that box is checked, the problem is that the UnityFramework scheme still isn't being added to the xcschemes folder on initial build. So even though the UnityFramework scheme exists, since it's not in that folder, the xcode build process is not able to find it.
     
  3. phuong_unity

    phuong_unity

    Unity Technologies

    Joined:
    Apr 25, 2018
    Posts:
    52
    Hi @keren_unity. In order for the Cloud Build team to investigate this issue, could you please open a support ticket and include a link to this forum thread?