element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Preparing to Develop Mobile Apps with Cordova
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: PEarle
  • Date Created: 25 Jan 2016 4:31 PM Date Created
  • Views 444 views
  • Likes 2 likes
  • Comments 1 comment
  • mobile
  • cordova
Related
Recommended

Preparing to Develop Mobile Apps with Cordova

PEarle
PEarle
25 Jan 2016

Cordova is an Apache project which allows you to develop mobile apps in HTML - so if you are competent with html and javascript, its quite a straight forward process to create apps. I've just bought a new MacBook which I need to set up with Cordova, so I thought I would document the steps as I go along. As you would expect with an Apache project, theres a ton of documentation available at https://cordova.apache.org/

 

I'm assuming that the reader is familiar with basic Unix operations, and use of the sudo command.

 

** Update - once you have read this, see Cordova - my first App  **

 

Install Android SDK

The first step before starting with the Cordova install is to install the relevant SDKs for the mobile app type you are going to develop - Im only interested in Android, so I need to install the Android SDK

 

  • Go to Download Android Studio and SDK Tools | Android Developers  and download Android Studio. An alternative is just do download the SDK but Im getting the complete studio in case I want to do any 'native' Android development later

Downloading and installing the SDK on Mac is very straightforward - and is fully explained at the above link - its just downloading the .dmg image, opening and dragging to the Applications folder.

 

Once you have done this you need to open Android Studio and run through the wizards which pop up, in order to complete the installation.

 

Having now installed the SDK, it needs to be configured in order to meet the requirements of Cordova. Attempting to build a Cordova project without following the next steps will result in the following fault

image

 

To change the configuration open the SDK Manager withe the following command

 

/Users/[username]/Library/Android/sdk/tools/android.

 

(If this doesnt work - i.e. this location is invalid, skip this step and continue with the steps below - then when you try and build your first project it will throw the error above which contains exact details of how to open the SDK manager !!)

 

When the SDK Manager is opened you need to make sure that Android API version 22 is installed (Android 5.1.1). I found that the default was Android 6 (API version 23) which is not compatible with Cordova. What I did was to uninstall Android 6 and instal Android 5.1.1).

 

It may well be that when you start trying to build Cordova projects you have to keep coming back to this point to tweak the configuration to match Cordova's requirements. The good news is that the Cordova build process seems to be quite good at giving meaningful error messages indicating what exactly is wrong with the Android setup.

 

 

Install Java SDK

  • Java SDK need to be installed - I had already done that - for more instructions go to Java SE - Downloads | Oracle Technology Network | Oracle (I installed Java 8 SDK).

 

Cordova Command Line Interface (CLI)

I intend to run Cordova from the command line so I followed the instructions at https://cordova.apache.org/docs/en/4.0.0/guide/cli/  as follows;

 

Install Node.js

Cordova uses Node JS commands in its CLI - therefore you need to install Node.js!

 

Go to https://nodejs.org/en/ and follow in e instructions there. On Mac the download opens its own installer which runs and finishes with the following prompt. Note the requirement to Make sure that /usr/local/bin is in your $PATH - this can be checked by typing echo"$PATH" in a terminal session.

 

image

 

Install Git client

Even if you are not using Git for source control, Cordova uses it behind the scene to download assets, so you will need to install a Got client. To check if you already have it installed type git at a command line - if its there you should see something like this. If not, go to Git  and follow the instructions there.

 

image

Download Cordova

Now Git client is installed, we can use the npm command to download Cordova. Type the following command into a terminal session

 

sudo npm install

 

This will download Cordova and install into location  /usr/local/lib/node_modules/cordova/

 

I've written a follow up blog at Cordova - my first App which details writing my first app.

  • Sign in to reply

Top Comments

  • ipv1
    ipv1 over 9 years ago +1
    Would love to see a followup post on this one. I am shifting from cordova to Android studio because it make more sense but would love a second opinion as well.
  • ipv1
    ipv1 over 9 years ago

    Would love to see a followup post on this one. I am shifting from cordova to Android studio because it make more sense but would love a second opinion as well.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube