3 The Nixpkgs repository contains facilities to deploy a variety of versions of
4 the [Titanium SDK](https://www.appcelerator.com) versions, a cross-platform
5 mobile app development framework using JavaScript as an implementation language,
6 and includes a function abstraction making it possible to build Titanium
7 applications for Android and iOS devices from source code.
9 Not all Titanium features supported -- currently, it can only be used to build
12 ## Building a Titanium app {#building-a-titanium-app}
14 We can build a Titanium app from source for Android or iOS and for debugging or
15 release purposes by invoking the `titaniumenv.buildApp {}` function:
18 titaniumenv.buildApp {
23 target = "android"; # or 'iphone'
24 tiVersion = "7.1.0.GA";
28 platformVersions = [ "25" "26" ];
30 androidKeyStore = ./keystore;
31 androidKeyAlias = "myfirstapp";
32 androidKeyStorePassword = "secret";
34 xcodeBaseDir = "/Applications/Xcode.app";
38 iosMobileProvisioningProfile = ./myprovisioning.profile;
39 iosCertificateName = "My Company";
40 iosCertificate = ./mycertificate.p12;
41 iosCertificatePassword = "secret";
43 iosBuildStore = false;
45 enableWirelessDistribution = true;
46 installURL = "/installipa.php";
50 The `titaniumenv.buildApp {}` function takes the following parameters:
52 * The `name` parameter refers to the name in the Nix store.
53 * The `src` parameter refers to the source code location of the app that needs
55 * `preRebuild` contains optional build instructions that are carried out before
57 * `target` indicates for which device the app must be built. Currently only
58 'android' and 'iphone' (for iOS) are supported.
59 * `tiVersion` can be used to optionally override the requested Titanium version
60 in `tiapp.xml`. If not specified, it will use the version in `tiapp.xml`.
61 * `release` should be set to true when building an app for submission to the
62 Google Playstore or Apple Appstore. Otherwise, it should be false.
64 When the `target` has been set to `android`, we can configure the following
67 * The `androidSdkArgs` parameter refers to an attribute set that propagates all
68 parameters to the `androidenv.composeAndroidPackages {}` function. This can
69 be used to install all relevant Android plugins that may be needed to perform
70 the Android build. If no parameters are given, it will deploy the platform
71 SDKs for API-levels 25 and 26 by default.
73 When the `release` parameter has been set to true, you need to provide
74 parameters to sign the app:
76 * `androidKeyStore` is the path to the keystore file
77 * `androidKeyAlias` is the key alias
78 * `androidKeyStorePassword` refers to the password to open the keystore file.
80 When the `target` has been set to `iphone`, we can configure the following
83 * The `xcodeBaseDir` parameter refers to the location where Xcode has been
84 installed. When none value is given, the above value is the default.
85 * The `xcodewrapperArgs` parameter passes arbitrary parameters to the
86 `xcodeenv.composeXcodeWrapper {}` function. This can, for example, be used
87 to adjust the default version of Xcode.
89 When `release` has been set to true, you also need to provide the following
92 * `iosMobileProvisioningProfile` refers to a mobile provisioning profile needed
94 * `iosCertificateName` refers to the company name in the P12 certificate.
95 * `iosCertificate` refers to the path to the P12 file.
96 * `iosCertificatePassword` contains the password to open the P12 file.
97 * `iosVersion` refers to the iOS SDK version to use. It defaults to the latest
99 * `iosBuildStore` should be set to `true` when building for the Apple Appstore
100 submission. For enterprise or ad-hoc builds it should be set to `false`.
102 When `enableWirelessDistribution` has been enabled, you must also provide the
103 path of the PHP script (`installURL`) (that is included with the iOS build
104 environment) to enable wireless ad-hoc installations.
106 ## Emulating or simulating the app {#emulating-or-simulating-the-app}
108 It is also possible to simulate the correspond iOS simulator build by using
109 `xcodeenv.simulateApp {}` and emulate an Android APK by using
110 `androidenv.emulateApp {}`.