Skip to end of metadata
Go to start of metadata

This document provides information on how to build cloud and mobile applications with Appcelerator CLI.

Build Cloud Applications

For more tasks, see API Builder Tools Project.

Create an Arrow Project

To create a new Arrow project, run the appc new command. The CLI will prompt you to fill in the necessary information to create a project, such as the name of the project. To create a new project with all the information specified in the command, run:

Run an Arrow Project

To run an Arrow project locally, run the appc run command from the project directory.

Publish an Arrow Project to Arrow Cloud

To deploy your Arrow application to the Arrow Cloud, run the appc publish command from the project directory.

Generate Cloud Components

To generate components, such as Models, Connectors, or Block, for your Arrow projects, run the appc generate command. When prompted for the type of component, select Arrow Component, then follow the subsequent directions.

The components generated by the command are modular components that need to be published using the appc publish command, then installed to your Arrow projects using the appc install command.

Build Mobile Applications

Once you have your development environment correctly configured, you can create and build mobile applications.

Create a Alloy Project

To create a new Alloy project, run the appc new command. The CLI will prompt you to fill in the necessary information to create a project, such as which platforms the application runs on and the name of the project. To create a new project with all the information specified in the command, run: 

Create a Titanium Project

To create a classic Titanium project, follow the same directions when creating an Alloy project, except add the --classic flag to generate a Titanium class project.

Build an Alloy or Titanium Project

To build an Alloy or Titanium project to test on a device, simulator or emulator, run the appc run command from the project directory. The CLI will prompt you to fill in the necessary information to build the project, such as which platform you want to test the application on. More detailed examples are listed below.

Once the application is installed and launched, use native tools to test, debug and profile your application. See Debugging and Profiling.

Icon

SDK Version Setting Precedence

The CLI checks several settings to see which SDK version to use to build your application. The following is a list of locations in the order of precedence. If an SDK version is not defined in that location, the next location is checked.

  1. tiapp.xml file version specified with the sdk-version tag.
    To change this version, manually edit the tiapp.xml file with a text editor or use Studio.
  2. --sdk command-line option with the appc run command.
  3. app.sdk setting specified with the appc ti config command.
    To check the version, run appc ti config and to change the version, run appc ti config app.sdk <sdk_version>.
  4. SDK select version.
    To check or change this version, run appc ti sdk select.

Android Emulator

You need to create an Android emulator or setup Genymotion before running these commands.

To build for an emulator, run appc run -p android. Because no other options were specified, the CLI launches your default Android emulator and installs the application on it.

To launch a specific Android or Genymotion emulator, add the -C <EMULATOR_NAME> option.

To retrieve a list of Android or Genymotion emulators, run the ti info -p android command.

Android Device

To build for an Android device, connect your device to the computer with a USB cable, then run:

iOS Simulator

To build for an iOS simulator, run appc run -p ios. Because no other options were specified, the CLI launches the application on the default iOS simulator.

To use a specific simulator, add the -C <DEVICE_UDID> option.

To retrieve the simulator's UDID, run the appc ti info -p ios command.

iOS Device

Before deploying to an iOS device for testing, you need to generate a development certificate and development provisioning profile. See Deploying to iOS devices.

The CLI allows you to install your application either to iTunes or directly to the device connected to your computer with a USB cable. If you select to install to iTunes, you need to sync your device to iTunes in order to install the application.

To build for an iOS device, run:

If you omit the -V and -P options, the CLI will prompt you with options. You can also retrieve the information from Xcode's Devices window or with the appc ti info -p ios command.

Mobile Web

To build for Mobile Web, run appc run -p mobileweb. The CLI creates an unminimized version of your mobile web application for you to debug. Copy the files in the ./build/mobileweb to a web server to test the application.

Windows Phone Emulator

Requires CLI and SDK 4.1.0.

To build for a Windows Phone emulator, you need to obtain your Windows publisher ID. After you have created your Windows Dev Center account, log in to https://dev.windowsphone.com/en-us/Account/Summary to get your publish GUID. 

To build for a Windows Phone emulator, run:

If you omit any of the optional parameters, the CLI will prompt you with options.

Windows Phone Publisher GUID

Icon

Prior to Release 5.0.0, you need to pass the -G option with your Windows Phone Publisher GUID rather than using the -I option with your Windows Publisher ID.

Windows Phone Device

Requires CLI and SDK 4.1.0.

To build for a Windows Phone emulator, you need to obtain your Windows publisher ID. After you have created your Windows Dev Center account, log in to https://dev.windowsphone.com/en-us/Account/Summary to get your publish GUID. 

To deploy to a Windows Phone device, connect the device to your computer with a USB cable, then run:

If you omit any of the optional parameters, the CLI will prompt you with options.

Windows Phone Publisher GUID

Icon

Prior to Release 5.0.0, you need to pass the -G option with your Windows Phone Publisher GUID rather than using the -I option with your Windows Publisher ID.

Windows Computer

Requires CLI and SDK 4.1.0.

To deploy the application to your local Windows machine, you will need a certificate. If you do not have a certificate, the CLI will launch the certificate maker for your to create one.

To deploy to your local machine, run:

If you omit any of the optional parameters, the CLI will prompt you with options. Prior to Release 5.0.0, the -I option was not required.

Package an Application

To package a mobile application, run the appc run command from the project directory.

Google Play APK

Before packaging an APK file for distribution, you need to generate a keypair and certificate for your application. See Distributing Android apps.

To package an APK for Google Play, run:

If you omit any of the optional parameters, you will be prompted by the CLI to enter these values. If the password for the private key of the keystore is different from the password for the keystore, add the --key-password <KEYPASS> option with the password of your private key.

iOS Ad Hoc Distribution

Before packaging for the iOS ad hoc distribution, you need to generate a distribution certificate and distribution provisioning profile. See Distributing iOS apps.

To package an IPA file for Ad Hoc distribution, run:

If you omit any of the optional parameters, the CLI will prompt you with options.

iTunes Store

Before packaging for the iTunes Store, you need to generate a distribution certificate and distribution provisioning profile, and have an iTunes Connect account. See Distributing iOS apps.

Icon

If you are using Mac OS X 10.9 (Mavericks), make sure you grant CLI access to the computer as described in Installing the iOS SDK: Note for Mavericks.

To package an APP bundle for the iTunes store, run:

The CLI installs the package to Xcode's Organizer and launches Organizer for you to start the submission process.

If you omit any of the optional parameters, the CLI will prompt you with options.

Mobile Web

To create a minified version of your Mobile Web application, run the ti build -p mobileweb -D production command. Deploy the files in the ./build/mobileweb to a web server.

Windows Phone Store

Requires CLI and SDK 4.1.0.

To package for the Windows Phone Store (ARM architecture), you need to obtain your Windows publisher ID. After you have created your Windows Dev Center account, log in to https://dev.windowsphone.com/en-us/Account/Summary to get your publish GUID. 

To package an APPX file for the Windows Phone Store, run:

If you omit any of the optionals parameters, the CLI will prompt you with options.

Windows Phone Publisher GUID

Icon

Prior to Release 5.0.0, you need to pass the -G option with your Windows Phone Publisher GUID rather than using the -I option with your Windows Publisher ID.

Windows Store

Requires CLI and SDK 4.1.0.

To package for the Windows Store (x86 architecture), you will need a certificate. If you do not have a certificate, the CLI will launch the certificate maker for your to create one.

To package an APPX file for the Windows Store, run:

If you omit any of the optional parameters, the CLI will prompt you with options. Prior to Release 5.0.0, the -I was not required.

Clean Your Build Folder

If you run into issues building your application, you may need to clean your build folder. Run the appc ti clean command or to clean for a specific platform, add the -p <PLATFORM> option.