Book Image

PhoneGap 4 Mobile Application Development Cookbook

Book Image

PhoneGap 4 Mobile Application Development Cookbook

Overview of this book

Table of Contents (19 chapters)
PhoneGap 4 Mobile Application Development Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Using the command line to create a new iOS Cordova project


A streamlined workflow is something that can benefit us all greatly by speeding up our processes and reducing the amount of manual work needed to complete a task.

How to do it...

In this recipe, we will explore the command-line tools available in Cordova for creating and running iOS applications from the terminal application:

  1. Create a new Cordova iOS project by running the following command:

    cordova create hello com.example.hello HelloWorld
    
  2. Change the directory to the newly created project:

    cd hello
    
  3. Add the iOS platform to the project:

    cordova platform add ios
    
  4. Open the project directory in the explorer, and you should see something like this:

  5. Open the /platform/ios directory and double-click on HelloWorld.xcodeproj. So, the project will be opened in Xcode, as shown here:

  6. If we choose to run the newly opened project via Xcode on a simulated device, the output will look something like this:

How it works...

The command-line tools available...