The Titanium Command-Line Interface (CLI) is a Node.js-based command-line tool for managing, building, and deploying Titanium projects.
Titanium CLI quick start
Getting started with the CLI only requires two steps:
- Install Node.js.
- Install and configure the CLI.
Install Node.js
The CLI requires Node.js 4 or later. It is highly recommended you use a LTS (long term support) Node.js release. If you don't have Node installed, install it from:
Before installing the CLI, you should decide where you want the Node Package
Manager (npm
) to install packages. By default npm
installs into /usr/local
on OS X, which requires that you run npm
as root. This is not recommended. You can avoid having to run npm
by doing one of the following:
- Make the
/usr/local
directory writable by all:sudo chmod 777 /usr/local
- Set
npm
to install to your home directory, or another directory of your choosing by setting thenpm
prefix. For example, you can add the following to your.bash_profile
or other initialization file:export NPM_CONFIG_PREFIX=$HOME
- In this case,
npm
packages are installed to$HOME/lib/node_modules
and launch scripts are installed in$HOME/bin
.$HOME/bin
must be in your PATH.
- In this case,
For more information, see Installing Node.
Install and configure the CLI
-
Install the
titanium
CLI.npm
install
titanium -g
-
Download the latest UNSTABLE Titanium SDK continuous integration build.
titanium sdk
install
--branch master --default
-
Configure CLI (optional).
titanium setup
The script prompts you to enter basic information, such as your name, default locale, default SDK version, and default workspace folder.
If you encounter an error installing titanium
, see Issues installing NPM packages.
Titanium commands
If you don't specify all of the required options, titanium
prompts you for the missing options.
Build
Builds and runs an application or module project.
1
2
3
4
5
|
# Titanium CLI titanium build --platform <platform> [--build-only] [--force] [--project- dir <value>] [--sdk <value>] [--log-level <level>] [ <platform_build_options>
] # Appcelerator CLI appc run --platform <platform> [--build-only] [--force] [--project- dir <value>] [--sdk <value>] [--log-level <level>] [ <platform_build_options>
] |
Generic build options and flags
Option |
Description |
---|---|
|
Only perform the build; when specified, does not install or run the app. |
|
Force a clean rebuild. |
--skip-js-minify |
Bypasses JavaScript minification. Simulator builds are never minified. Only supported for Android and iOS. |
|
Minimum logging level. Supported options are trace, debug, info, warn, and error. |
|
Target build platform: Supported values are android, ios, and windows. (iphone and ipad are currently accepted as synonyms for ios.) |
|
Directory containing the project, otherwise the current working directory is assumed. |
|
Titanium SDK version to build with. If not specified, uses the configured default SDK. |
Android build options
Option |
Description |
---|---|
|
Path to the Android SDK. |
-C, --device-id <name> |
Name of the device or emulator to install the application to. When --target is "device", then you can specify "all" to install the app to all connected devices. |
-D, --deploy-type <type> |
Controls several settings such as optimization, encryption, and analytics. Type can be development, test, or production. When --target is "emulator", the deploy type defaults to development, but can be set to test. When --target is "device", the deploy type defaults to test, but can be set to development. When --target is "dist-playstore", the deploy type is production and cannot be overwritten. Note that test will minify and encrypt your JavaScript source code. Any JavaScript syntax errors, even files you are not using, will result in a build failure. |
|
Location of the keystore file. |
--key-password <keypass> |
Password of the keystore private key. Defaults to value specified with --store-password. |
--liveview |
Starts a LiveView session to let you quickly preview changes to your application's UI. Requires Appcelerator Studio. |
|
Alias for the keystore. |
--no-launch |
Disables launching the app after installing. |
|
Output directory (used when |
-P, --store-password <password> |
Password for the keystore. |
--sigalg <algorithm> |
The digital signature algorithm to sign the .apk with. Possible algorithms are MD5withRSA, SHA1withRSA, and SHA256withRSA. |
|
Target to build for. Target can be emulator, device, or dist-playstore. |
iOS build options and flags
Option |
Description |
---|---|
-C, --device-id <name> |
Name of the device or emulator to install the application to. When --target is "device", then you can specify "all" to install the app to all connected devices. |
|
Controls several settings such as optimization, encryption, and analytics. Type can be development, test, or production. When --target is "simulator", the deploy type defaults to development, but can be set to test. When --target is "device", the deploy type defaults to test, but can be set to development. When --target is "dist-appstore" or "dist-adhoc", the deploy type is production and cannot be overwritten. Note that test will minify and encrypt your JavaScript source code. Any JavaScript syntax errors, even files you are not using, will result in a build failure. |
--force-copy |
Forces files to be copied instead of symlinked for simulator builds only. |
--force-copy-all |
|
--launch-watch-app |
Launch both the watch app and main app; only used when target is simulator. |
--launch-watch-app-only |
Launch only the watch app; only used when target is simulator. |
--sim-focus |
Focus the iOS simulator (default is true). To not focus the simulator, use --no-sim-focus. |
|
iOS Developer Certificate to use; required when target is device. |
|
Device family to build for (iphone, ipad, or universal). Default is universal, however if --target is set to "ipad", then the value defaults to ipad. |
|
iOS SDK version to build for. Default: latest installed iOS SDK. |
|
Path to the distribution keychain to use instead of the system default; only used when target is device, dist-appstore, or dist-adhoc. |
--launch-bundle-id <id> |
After installing the app in the iOS Simulator, launch a different app instead of the app that was just built. Useful if you need to launch a test runner that in turn launches your app. |
|
Output directory. Only used when target is dist-adhoc. |
|
Provisioning profile uuid; required when target is device, dist-appstore, or dist-adhoc. |
|
iOS Distribution Certificate to use; required when target is dist-appstore or dist-adhoc. |
--sim-focus |
Focus the iOS Simulator after launching. Defaults to true. |
|
Target to build for: simulator, device, dist-appstore, or dist-adhoc. |
--watch-app-name <name> |
Name of the watch app to launch; only used when target is simulator. |
-W, --watch-device-id <udid> |
Watch simulator UDID to launch when building an app with a watch app; only used when target is simulator. |
-Y, --sim-type <type> |
iOS Simulator type: iphone or ipad; only used when target is simulator. |
Windows build options
Options
|
Description
|
---|---|
-C, --device-id <value> |
UDID of the Windows Phone 8 device or emulator to build for. Only used when the target is wp-emulator or wp-device. Note: An app can only be installed to a single device at a time. |
|
Type of deployment (test, development or production). Only used when the target is wp-emulator, wp-device or ws-local. |
-G, --wp-publisher-guid <GUID> |
Windows Phone Publisher ID. Only used when the target is wp-emulator, wp-device or dist-phonestore. |
-I, --win-publisher-id <ID> |
Windows Publisher ID. Required to build the application. |
--wp-product-guid <GUID> |
Deprecated as of 6.1.0. Windows 8 product ID, used for upgrading Win 8 apps to Win 8.1. Deprecated and will be removed in future version, use --win-product-guid instead. |
-H, --win-product-guid <GUID> |
Since Release 6.1.0. Windows 10 product ID, used for upgrading Windows 8.1 apps to Windows 10. |
|
Output directory. Only used when target is dist-phonestore or dist-winstore. |
--ws-cert <file> |
Deprecated as of Release 6.1.0. Location of the Windows Store certificate file. Only used when target is ws-local or dist-winstore. Deprecated and will be removed in future version, use --win-cert instead. |
-R, --win-cert <file> |
Since Release 6.1.0. Location of the Windows Store certificate file. Only used when target is ws-local or dist-winstore. |
--wp-sdk <version> |
Deprecated as of Release 6.1.0. Windows Phone SDK version. Deprecated and will be removed in future version, use --win-sdk instead. |
-S, --win-sdk <version> |
Since Release 6.1.0. Windows SDK version. When you run CLI on Windows 10, you can specify
10.0 to indicate building for Windows 10 Universal Windows Platform (UWP) app. You can target more specific SDK version, such as 10.0.15063.0 . |
-V, --vs-target <version> |
Visual Studio target to build for.
|
|
Target to build for:
|
--skipInstallDependencies |
Since Release 6.1.0. Skip installing dependency packages. If you had trouble with app deployment on device, try this option. |
Clean
Removes the build directories for an application or module project.
1
2
3
4
5
|
# Titanium CLI titanium clean [ --platform <platform> ] [--project- dir <value>] [--sdk <value>] [--log-level <level>] # Appcelerator CLI appc ti clean [ --platform <platform> ] [--project- dir <value>] [--sdk <value>] [--log-level <level>] |
Best practice: don't use releases as a means of archiving. Releases should be published
in a stable location such as Github, S3, etc. But, if you wish to keep
old releases in the module, you should consider using a different folder
to archive your content in the dist
folder and commit that zip to your source control before cleaning.
Clean options
Option |
Description |
---|---|
|
Minimum logging level. Supported options are trace, debug, info, warn, and error. |
|
A single platform to clean: android, ios, and windows. |
|
Directory containing the project, otherwise the current working directory is assumed. |
|
Titanium SDK version to build with. If not specified, uses the configured default SDK. |
Config
Gets and sets configuration options. If no key is specified, then all key/values are returned.
1
2
3
4
5
|
# Titanium CLI titanium config [--remove] [--output <value>] [<key>] [<value>] # Appcelerator CLI appc ti config [--remove] [--output <value>] [<key>] [<value>] |
Config Options
Option |
Description |
---|---|
-a, --append | Appenda a value to a key containing a list of values. |
-r, --remove |
Removes the specified config key and all its descendants. |
-o, --output <value> |
Selects the output format: report, json, or json-object. Defaults to report. |
Create
Creates a new application or module project.
1
2
3
4
5
|
# Titanium CLI titanium create [ -- type < type > ] [ --platforms <platforms> ] [--project- dir <value>] [--sdk <value>] [--log-level <level>] # Appcelerator CLI appc new [ -- type < type > ] [ --platform <platforms> ] [--project- dir <value>] [--sdk <value>] [--log-level <level>] |
Create options
Option |
Description |
---|---|
|
Force creation of the project, even if the path already exists. |
|
Application ID. For uniqueness, application IDs should be based on a registered
domain name, in reverse-DNS order (for example, |
|
Minimum logging level. Supported options are trace, debug, info, warn, and error. |
|
Project template to use--either a name of a template to use or files to copy over to the newly created project. The file to be copied over can either be placed in a directory, ZIP file or ZIP file with a remote URL. |
|
Directory to place the project in. Defaults to the workspace directory
set in the |
|
Name of the project. Used as the default human-readable name for the project. |
|
Comma-separated list of platforms: supported values are android, ios, and windows. (iphone and ipad are currently accepted as synonyms for ios.) |
|
Titanium SDK version to build with. If not specified, uses the configured default SDK. This can be changed later in the tiapp.xml. |
|
Type of project to create (defaul:
|
-u --url <value> |
Your company/personal URL. |
Help
Displays the help screen.
1
2
3
4
5
6
7
8
9
10
11
|
# Titanium CLI titanium help titanium help < command > titanium --help titanium < command > --help # Appcelerator CLI appc ti help appc ti help < command > appc ti --help appc ti < command > --help |
Info
Displays development environment information.
1
2
3
4
5
|
# Titanium CLI titanium info [--output <value>] [--types <value>] # Appcelerator CLI appc ti info [--output <value>] [--types <value>] |
Info options
Option |
Description |
---|---|
|
Selects the output format: report or json. Defaults to report. |
|
Comma-separated list of types to display: all, os, nodejs, titanium, ios, jdk, haxm and android. Defaults to all. |
Module
Manages installed Titanium modules.
1
2
3
4
5
|
# Titanium CLI titanium module [<subcommand>] # Appcelerator CLI appc ti module [<subcommand>] |
Module list
Prints a list of installed modules.
1
2
3
4
5
6
7
|
# Titanium CLI titanium module [--output <value>] [--project- dir <value>] titanium module list [--output <value>] [--project- dir <value>] # Appcelerator CLI appc ti module [--output <value>] [--project- dir <value>] appc ti module list [--output <value>] [--project- dir <value>] |
Module list options
Option |
Description |
---|---|
|
Selects the output format: report, json or grid. Defaults to report. |
|
Directory of the project to analyze. Defaults to the current working directory. |
Plugin
Manages installed Titanium plugins.
1
2
3
4
5
|
# Titanium CLI titanium plugin [<subcommand>] # Appcelerator CLI appc ti plugin [<subcommand>] |
Plugin list
Prints a list of installed plugins.
1
2
3
4
5
6
7
|
# Titanium CLI titanium plugin [--output <value>] [--project- dir <value>] titanium plugin list [--output <value>] [--project- dir <value>] # Appcelerator CLI appc ti plugin [--output <value>] [--project- dir <value>] appc ti plugin list [--output <value>] [--project- dir <value>] |
Plugin list options
Option |
Description |
---|---|
|
Selects the output format: report, json or grid. Defaults to report. |
|
Directory of the project to analyze. Defaults to the current working directory. |
Project
Gets tiapp.xml
settings.
It also allows you to set the deployment-targets using a comma-separated list of platforms. If a specific platform is being enabled for the first time, it will also non-destructively copy that platform's default resources into your project's Resources folder. For example, if your app currently supports "iphone" and you wish to add Android support, you must specify "iphone,android". Note that the deployment target requires you to explicitly set "iphone" and "ipad".
1
2
3
4
5
|
# Titanium CLI titanium project [--output <value>] [--project- dir <value>] [--template <value>] [--sdk <value>] [--log-level
<level>] [<key>] [<value>] # Appcelerator CLI appc ti project [--output <value>] [--project- dir <value>] [--template <value>] [--sdk <value>] [--log-level
<level>] [<key>] [<value>] |
Project options
Option |
Description |
---|---|
|
Selects the output format: report, json or text. Defaults to report. |
|
Directory containing the project, otherwise the current working directory is assumed. |
SDK
Manages installed Titanium SDKs.
1
2
3
4
5
|
# Titanium CLI titanium sdk [<subcommand>] # Appcelerator CLI appc ti sdk [<subcommand>] |
SDK install
Downloads the latest Titanium SDK or a specific version.
1
2
3
4
5
6
7
|
# Titanium CLI # Can only install Titanium SDK 4.0.0.GA and older or UNSTABLE continuous
integration builds titanium sdk install [<version>] [--default] [--force] [--branch <branch name>] # Appcelerator CLI # Can install any GA Titanium SDK release or UNSTABLE continuous integration
build appc ti sdk install [<version>] [--default] [--force] [--branch <branch name>] |
<version>
may be either a specific version number, such as 3.1.3.GA
or a URL to a continuous integration build, such as http://builds.appcelerator.com.s3.amazonaws.com/mobile/3_1_X/mobilesdk-3.1.3.v20130904134612-osx.zip
.
To override this behavior, set the sdk.defaultInstallLocation
key to a path where you want to install the SDKs, for example:
1
2
3
4
5
|
# Titanium CLI titanium config sdk.defaultInstallLocation /path/to/intall/sdks # Appcelerator CLI appc ti config sdk.defaultInstallLocation /path/to/intall/sdks |
SDK install options
Option |
Description |
---|---|
|
Sets as the default SDK. |
|
Forces reinstallation. |
-k, --keep-files |
Keep downloaded files after install. |
|
Branch to install or "latest". |
SDK list
Prints a list of installed SDK versions.
1
2
3
4
5
6
7
|
# Titanium CLI titanium sdk [--branches] [--releases] [--output <value>] titanium sdk list [--branches] [--releases] [--output <value>] # Appcelerator CLI appc ti sdk [--branches] [--releases] [--output <value>] appc ti sdk list [--branches] [--releases] [--output <value>] |
SDK list options
Option |
Description |
---|---|
|
Retrieves and prints all branches. |
|
Retrieves and prints all releases. |
|
Selects the output format: report or json. Defaults to report. |
SDK select
Used to select which installed Titanium SDK is the active SDK. This
is not the SDK your application will be built with but the SDK used to
run the CLI commands. However, if the tiapp.xml
file does not contain an SDK version or the app.sdk
setting is not set with titanium config
, then the application will be built with the SDK select version. If
the SDK selected is ever deleted or if you are missing CLI commands, select
a new active SDK.
1
2
3
4
5
|
# Titanium CLI titanium sdk select [<version>] # Appcelerator CLI appc ti sdk select [<version>] |
SDK uninstall
1
2
3
4
5
|
# Titanium CLI titanium sdk uninstall [<version>] [--force] # Appcelerator CLI appc ti sdk uninstall [<version>] [--force] |
Uninstalls a specific Titanium SDK version.
SDK uninstall options
Option |
Description |
---|---|
|
Forces uninstallation without confirmation. |
SDK update
Finds the latest version of the Titanium SDK.
1
2
3
4
5
|
# Titanium CLI titanium sdk update [--default] [--force] [-- install ] [--branch <branch name>] # Appcelerator CLI appc ti sdk update [--default] [--force] [-- install ] [--branch <branch name>] |
SDK update options
Option |
Description |
---|---|
|
Sets as the default SDK. |
|
Forces reinstallation. |
|
Installs the latest version. |
|
Branch to update from. |
Setup
Runs the setup wizard.
1
2
3
4
5
6
7
|
# Titanium CLI titanium setup titanium setup <section> # Appcelerator CLI appc ti setup appc ti setup <section> |
The "section" can be one of: quick, check, user, app, network, cli, sdk, ios, android, and paths.