PhoneGap CLI: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "=== Overview === PhoneGap Build is an easy to use service for creating native apps. However, you can also use PhoneGap CLI with AppStudio. It has the following advantages: *...")
 
Line 34: Line 34:
PhoneGap CLI looks for a number of files in your project folder (or elsewhere if you have specified in Preferences). When you start a new project, you need to run a command to initialize the the directories. When you do a deploy from AppStudio, it updates these directories with your code.
PhoneGap CLI looks for a number of files in your project folder (or elsewhere if you have specified in Preferences). When you start a new project, you need to run a command to initialize the the directories. When you do a deploy from AppStudio, it updates these directories with your code.


To initialize a project so you can use it with PhoneGap CLI, use these commands in the project folder:
To initialize a project so you can use it with PhoneGap CLI, use these commands in your project folder:
<pre>
<pre>
mkdir phonegap
cordova create phonegap com.example.helloworld HelloWorld
cd phonegap
cd phonegap
cordova create hello com.example.hello HelloWorld
cordova platform add android
</pre>
</pre>
This will create a phonegap directory in your project and set it to make Android apps.


=== Set AppStudio Options ===
=== Set AppStudio Options ===

Revision as of 19:17, 5 November 2014

Overview

PhoneGap Build is an easy to use service for creating native apps. However, you can also use PhoneGap CLI with AppStudio. It has the following advantages:

  • Build takes place on your local machine - no uploading to a service
  • Free - PhoneGap CLI is open source.
  • No limit on number of projects
  • Use the latest plugins: Sometime developers have newer versions of their plugin that are not in PhoneGap Build yet.
  • Use PlugIns which are not in PhoneGap Build at all.
  • Use custom PlugIns you have developed yourself.

But there are some disadvantages:

  • Much more complicated to get working
  • More difficult to use
  • More difficult to sign apps for release

Install Tools

You need to do the following steps:

  1. Install Node.js
  2. Install Android SDK
  3. Install Java Development Toolkit (JDK)
  4. Install Apache ANT
  5. Set user variables
  6. Add items to PATH
  7. Install Cordova

There is a good tutorial on doing this here: http://www.scribd.com/doc/242544944/Phone-Gap

Create PhoneGap Project Files

PhoneGap CLI looks for a number of files in your project folder (or elsewhere if you have specified in Preferences). When you start a new project, you need to run a command to initialize the the directories. When you do a deploy from AppStudio, it updates these directories with your code.

To initialize a project so you can use it with PhoneGap CLI, use these commands in your project folder:

cordova create phonegap com.example.helloworld HelloWorld
cd phonegap
cordova platform add android

This will create a phonegap directory in your project and set it to make Android apps.

Set AppStudio Options

Build Your App

Run Your App on the Android Emulator

Signing Your App For Release