Search Unity

Why doesn't Unity build an IPA directly?

Discussion in 'iOS and tvOS' started by dri_richard, Aug 19, 2019.

  1. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    I know that Xcode is required to build for iOS, but why does Unity not use the Xcode command line tools (e.g. xcodebuild) to complete the process, rather than require the user to finish it?

    It stands in contrast to the Android build process which can build an .apk with Gradle. It notably doesn't export a Gradle project and require me to build it - although that is an option.

    Of course various 3rd party utilities exist to automate this, and it's not too difficult to call xcodebuild, but my question remains - why do the iOS and Android build processes vary so much in terms of how much is left to the developer?

    I write this as someone who's been in the industry for 20 years but is relatively new to Unity so am still in "question everything" mode.
     
  2. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    Trust me. You don't want Unity to build IPA.
    You want it to export a project file to use native tools available for target platform.
    The lack of exporting a project for macOS for example is a huge PITA.

    I have a history with Unity since 3.0, I think, and any serious production would absolutely require you to build final executable with native target tools.
     
  3. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    I should clarify. I want Unity to invoke the native tools, in particular xcodebuild.
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
  5. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    I think this is a minor issue that can easily be done in BuildPostProcess with a few lines of code. It's much easier to implement it yourself than to wait for Unity to provide a solution. For example, we launch Code Signing shell script from BuildPostProcess when targeting macOS - took me an hour or so to write such post-processing behaviour.
     
  6. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
  7. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    Yes I could write it myself, or use one of the available Asset Store solutions.

    But I still don't understand why the Android and iOS build processes differ so much, and why there's no plan to align them.
     
  8. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    564
    Unreal does this.

    It's a freakin' nightmare. It removes the ONE CHANCE you have to fix things, if the building app screws them up.