jerkovicl
3/12/2015 - 9:57 AM

Telerik AppBuilder CLI commands

Telerik AppBuilder CLI commands

Quick Start

  1. Log In
  2. Create Project
  3. Run in Simulator
  4. Run on Device
  5. Modify Your Code
  6. Get Code Changes in the Simulator and on Device
  7. Modify the Application Package with .abignore
  8. Get Help
  9. Useful Commands

1. Log in the Telerik Platform

To connect to your Telerik Platform account, run the following command.

$ appbuilder login

A new tab opens in your default browser. Provide your login credentials, confirm the sign in, verify that the following message is present in the command line: Login completed, and close the browser tab after the confirmation.

2. Create project

Create new project from template

To create a new hybrid project from the default template, navigate to an empty directory and run the following command.

$ appbuilder create hybrid MyApp

The Telerik AppBuilder CLI creates a new subdirectory MyApp in the current directory and places the project files inside it. The project is based on the Kendo UI TabStrip template.

Create new project from existing project

To initialize an existing project for development from the command line, navigate to the local directory that contains the project files and run the following command.

$ appbuilder init

The Telerik AppBuilder CLI attempts to retain any existing project configuration and, if missing, creates any AppBuilder-specific files required for development. If the directory contains an existing AppBuilder project, after the operation completes, you might want to manually set new unique values for the WP8ProductID and WP8PublisherID properties to avoid issues when running your app on device.

For more information about how to configure your project properties, run appbuilder prop --help.

Create new project from sample

To create a new project from the AppBuilder sample apps from the command line, navigate to an empty directory and run the following command.

appbuilder sample clone <Sample>

To list the available sample apps, run appbuilder sample.

The Telerik AppBuilder CLI creates a new subdirectory in the current directory, clones the sample inside it and preserves the existing project configuration of the sample app.

If you want to develop for Windows Phone, make sure to manually set new unique values for the WP8ProductID and WP8PublisherID properties to avoid issues when running your app on device. For more information about how to configure your project properties, run appbuilder prop --help.

3. Run in simulator

To load your newly created project in the simulator, navigate to the folder containing your project files and run the following command.

$ appbuilder simulate

In this version of the Telerik AppBuilder CLI, you cannot run the device simulator on Linux systems.

The Telerik AppBuilder CLI launches the device simulator. In the device simulator, you can change the target device form factor, mobile platform and version, and orientation. You can adjust the geolocation details, network connection configuration, file storage configuration, and the default contacts. You can debug your code using the built-in debug tools.

For more information about the Telerik AppBuilder device simulator, see Running Apps in the Device Simulator.

4. Run on device

To run your app on an Android device, install a QR code reader on the device, install the Telerik AppBuilder companion app, navigate to the folder containing your project files and run the following command in the command line.

$ appbuilder build android --companion

After the operation completes, the Telerik AppBuilder CLI opens a new tab in your browser and shows a QR code for deployment in the companion app. On the device, use the built-in QR code scanner in the companion app to scan the QR code and load the project. To toggle the built-in QR code scanner, run the companion app and complete the tutorial. With two fingers, tap and swipe the left edge of the screen to the right and tap QR Scanner.

With the Telerik AppBuilder companion app, you can deploy and test your Android apps without the need to configure any device drivers on your system, to configure your device for deployment, and to build an application package. You can get the Telerik AppBuilder companion app from Google Play.

To run your app on an iOS device, install the Telerik AppBuilder companion app on the device, run it, and navigate to the folder containing your project files and run the following command in the command line.

$ appbuilder build ios --companion

After the operation completes, the Telerik AppBuilder CLI opens a new tab in your browser and shows a QR code for deployment in the companion app. On the device, use the built-in QR code scanner in the companion app to scan the QR code and load the project. To toggle the built-in QR code scanner, run the companion app and complete the tutorial. With two fingers, tap and swipe the left edge of the screen to the right and tap QR Scanner.

With the Telerik AppBuilder companion app, you can deploy and test your iOS apps without the need to provision them first. You can get the Telerik AppBuilder companion app from the App Store.

To run your app on a Windows Phone device, install a QR code reader on the device, navigate to the folder containing your project files and run the following command in the command line.

$ appbuilder build wp8 --companion

After the operation completes, the Telerik AppBuilder CLI opens a new tab in your browser and shows a QR code for deployment in the companion app. On the device, use the built-in QR code scanner in the companion app to scan the QR code and load the project. To toggle the built-in QR code scanner, run the companion app, with two fingers, tap and swipe the left edge of the screen to the right and tap QR Scanner.

With the Telerik AppBuilder companion app, you can deploy and test your iOS apps without the need to provision them first. You can get the Telerik AppBuilder companion app from the Windows Phone Store.

5. Modify your code

Edit your code in your preferred IDE or code editor. Save your changes.

In Sublime Text 2 and Sublime Text 3, you can install the Telerik AppBuilder package which provides integration with the Telerik AppBuilder CLI. For more information, click here.

6. Get code changes in the simulator and on device

In the running device simulator, your app refreshes automatically on save.

To get changes inside your running app, navigate to the folder containing your project files and run the following command.

$ appbuilder livesync cloud

On the device, in the running app, tap and hold with three fingers until the download pop-up appears. After the download completes, the app refreshes automatically.

7. Modify the application package with .abignore

When you develop apps with the Telerik AppBuilder Command-Line Interface (AppBuilder CLI), you can choose which files to exclude from your application package. To set exclude and include rules, you can modify the .abignore file in the root of your project.

Starting with AppBuilder 2.6, all newly created projects or cloned sample apps contain a default .abignore. To manage the exclude and include rules for projects created with earlier versions of AppBuilder, you need to manually add .abignore to your project.

For more information about creating and maintaining your .abignore file, see this manual.

8. List the available commands

To list the available commands, run the following command.

$ appbuilder help

To learn more about a command, run the command with the --help option. For example, to show more information about create, run the following command.

$ appbuilder create --help

AppBuilder 2.9 Release help commands:

$ appbuilder <Command> -h // context-aware console help
$ appbuilder help <Command> // extended HTML help

9. Install, update and troubleshoot npm package

Install,reinstall & update package:

npm cache clean
npm uninstall -g appbuilder
npm install -g appbuilder
npm update -g appbuilder

[Back to Top][1]