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

Discussion Incrementing Cloud Builds bundle number

Discussion in 'Unity Build Automation' started by MxHush, Dec 2, 2022.

  1. MxHush

    MxHush

    Joined:
    Oct 3, 2022
    Posts:
    10
    Hello,
    so im using this bash script to upload my Cloud Build into Testflight after a successful build, how can i automatically increment my build number without changing it manually from the editor ?

    Code (CSharp):
    1. #!/bin/bash
    2. echo "Uploading IPA to Appstore Connect..."
    3.  
    4. cd $WORKSPACE/.build/last/$TARGET_NAME/
    5. ls
    6. path="$WORKSPACE/.build/last/$TARGET_NAME/build.ipa"
    7. if xcrun altool --upload-app --type ios -f $path -u $APPSTORENAME -p $APPSTOREPASS ;
    8. then
    9.     echo "Upload IPA to AppStore Connect finished with success"
    10. else
    11.     echo "Upload IPA to AppStore Connect failed"
    12. fi
    13.  
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,077
  3. MxHush

    MxHush

    Joined:
    Oct 3, 2022
    Posts:
    10
  4. MxHush

    MxHush

    Joined:
    Oct 3, 2022
    Posts:
    10
    Hey @tonemcbride im having a new issue regarding the bash script for testflight i attached in earlier post, it cant find the path, it was working fine but suddenly it stopped working for all projects it keep failing uploading to testflight, any idea why ?
    PS : it was working using the same script i didnt change anything
    Code (CSharp):
    1. Error: Error uploading '$MyWorkSpace/.build/last/$MyTargetID/build.ipa'.
    2. Unable to upload archive. The file '$MyWorkSpace/.build/last/$MyTargetID/build.ipa'. cannot be found. (-43)
     
  5. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,077
    Hi, It seems that Unity has changed the executable name from build.ipa to the name of the target now. Instead of:

    path="$WORKSPACE/.build/last/$TARGET_NAME/build.ipa"

    it should be:

    path="$WORKSPACE/.build/last/$TARGET_NAME/$TARGET_NAME.ipa"

    There's a better discussion about it here too: https://forum.unity.com/threads/path-to-the-final-ipa-file.754331/page-2#post-8658531
     
    MxHush likes this.
  6. MxHush

    MxHush

    Joined:
    Oct 3, 2022
    Posts:
    10
    You are a beast tone Thanks alot, i will test it out and give you updates
     
    tonemcbride likes this.
  7. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    242
    I would recommend using the UNITY_PLAYER_PATH environment variable instead of hardcoding the path like y'all have there.