Home Explore Blog Models CI



nixpkgs

2nd chunk of `doc/languages-frameworks/ios.section.md`
bf5380d44d7deb0189bcc4e65e1d6ac4bac84826ee103fae0000000100000a2a
  sdk = null; # null will set it to 'iphonesimulator` for simulator builds or `iphoneos` to real builds
  xcodeFlags = "";

  release = true;
  certificateFile = ./mycertificate.p12;
  certificatePassword = "secret";
  provisioningProfile = ./myprovisioning.profile;
  signMethod = "ad-hoc"; # 'enterprise' or 'store'
  generateIPA = true;
  generateXCArchive = false;

  enableWirelessDistribution = true;
  installURL = "/installipa.php";
  bundleId = "mycompany.myapp";
  appVersion = "1.0";

  # Supports all xcodewrapper parameters as well
  xcodeBaseDir = "/Applications/Xcode.app";
}
```

The above function takes a variety of parameters:

* The `name` and `src` parameters are mandatory and specify the name of the app
  and the location where the source code resides
* `sdkVersion` specifies which version of the iOS SDK to use.

It also possible to adjust the `xcodebuild` parameters. This is only needed in
rare circumstances. In most cases the default values should suffice:

* `target` specifies which `xcodebuild` target to build. By default it takes the target
  that has the same name as the app.
* The `configuration` parameter can be overridden if desired. By default, it
  will do a debug build for the simulator and a release build for real devices.
* The `scheme` parameter specifies which `-scheme` parameter to propagate to
  `xcodebuild`. By default, it corresponds to the app name.
* The `sdk` parameter specifies which SDK to use. By default, it picks
  `iphonesimulator` for simulator builds and `iphoneos` for release builds.
* The `xcodeFlags` parameter specifies arbitrary command line parameters that
  should be propagated to `xcodebuild`.

By default, builds are carried out for the iOS simulator. To do release builds
(builds for real iOS devices), you must set the `release` parameter to `true`.
In addition, you need to set the following parameters:

* `certificateFile` refers to a P12 certificate file.
* `certificatePassword` specifies the password of the P12 certificate.
* `provisioningProfile` refers to the provisioning profile needed to sign the app
* `signMethod` should refer to `ad-hoc` for signing the app with an ad-hoc
  certificate, `enterprise` for enterprise certificates and `app-store` for App
  store certificates.
* `generateIPA` specifies that we want to produce an IPA file (this is probably
  what you want)
* `generateXCArchive` specifies that we want to produce an xcarchive file.

When building IPA files on Hydra and when it is desired to allow iOS devices to
install IPAs by browsing to the Hydra build products page, you can enable the

Title: Configuring iOS Application Builds with Nix `xcodeenv.buildApp`
Summary
This document details the extensive parameters available for the `xcodeenv.buildApp` function within the Nix ecosystem, used for building iOS applications. Mandatory parameters include `name` for the application's identifier, `src` for its source code location, and `sdkVersion` for the target iOS SDK. The function also allows for customization of `xcodebuild` parameters such as `target`, `configuration`, `scheme`, `sdk`, and `xcodeFlags`, with sensible defaults provided for most cases. For release builds targeting real iOS devices, the `release` parameter must be set to `true`, requiring additional parameters for code signing: `certificateFile` (P12), `certificatePassword`, `provisioningProfile`, and `signMethod` (e.g., `ad-hoc`, `enterprise`, `app-store`). Users can also specify whether to generate an IPA file (`generateIPA`) or an xcarchive file (`generateXCArchive`). The document also briefly mentions the ability to enable wireless distribution for IPA files when building on Hydra.