Command-Line Builds & Uploads

8.5. Can I Build or Upload My iOS or macOS Projects from the Command Line?

Yes, the Darwin Build Environment is designed to support command-line operations, making it suitable for automation and integration with CI/CD (Continuous Integration/Continuous Deployment) systems.

Building from the Command Line:

  1. Using make.cmd (Project-Specific):

    • Navigate to your project's root directory (where its make.cmd file is located).

    • Execute the script:

      make.cmd
    • This will compile and package your project based on the settings within that make.cmd file.

  2. Using the Master build.cmd Script (More Control):

    • The core build logic resides in the build.cmd script located at the root of the Darwin Build Environment installation path (e.g., C:\Program Files\DarwinBuildEnvironment\build.cmd).

    • This script accepts various command-line arguments for more granular control over the build process.

    • To see the available options, run it with the /? flag:

      "%DARWINBUILDENV_PATH%\build.cmd" /?

      (Replace %DARWINBUILDENV_PATH% with the actual installation path if the environment variable isn't set or recognized in your current shell.)

    • Studying this script and its parameters is recommended if you intend to create an automated build chain.

Uploading from the Command Line:

  • OTA Deployment (ideployota.exe):

    • As mentioned in Section 3.1, the ideployota.exe tool can be used from the command line to deploy app packages over the air.

    • Example:

      "%DARWINBUILDENV_PATH%\ideployota.exe" YourApp.ipa qrcode
  • App Store Connect Uploads:

    • The "App Store Connect upload tool" is primarily a GUI tool. For command-line uploads to App Store Connect, Apple provides official tools like Transporter (which typically runs on macOS, though command-line versions or APIs might be available for other platforms, check current Apple documentation).

    • Alternatively, you might explore third-party command-line tools or scripts that interact with the App Store Connect API (e.g., fastlane's deliver or pilot tools, though fastlane is Ruby-based and usually run in Unix-like environments). The Darwin Build Environment itself, as per the original document, focuses its upload tool as a GUI component. Direct command-line upload to App Store Connect using only the provided DBE tools might be limited to invoking the GUI tool if it supports command-line arguments for automation, which is not explicitly stated.

General Tips for Command-Line Use:

  • Environment Variables: Ensure that any necessary environment variables (like %DARWINBUILDENV_PATH%) are correctly set in your command-line shell or automation scripts.

  • Path Management: Be mindful of current working directories and paths to scripts, project files, and SDK components.

  • Error Handling: Check exit codes from the scripts (%ERRORLEVEL% in Windows batch) to determine if a step succeeded or failed in your automation.

Last updated