2 minutes reading time (386 words)

Cordova Installation

Cordova Installation

Many people have a problem of setting up and installing cordova, just to make things easier thought of writing a blog about it.
So, before starting cross platform mobile application development using cordova, you should configure your machine. It is always hard to install and configure for the newbies. There are so many platforms available like Mac, Windows, Linux etc. This will help you to setup Cordova on Mac and Linux OS. 

Steps to Install Cordova

  • Go to the Node.js site and click on the INSTALL button.
  • Now you have to setup Cordova-CLI,
    • Open the Terminal and follow the command
      • cd
      • $ sudo npm install -g cordova
    • The -g flag above tells npm to install cordova globally. Otherwise it will be installed in the node_modules subdirectory of the current working directory.
    • You may need to add the npm directory to your PATH in order to invoke globally installed npm modules.
    • On Windows, npm can usually be found at C:\Users\username\AppData\Roaming\npm. 
      • Go to the environment variable and set the path in the system.
    • On OS X and Linux it can usually be found at /usr/local/share/npm.
      • For MAC use command 
        $ vi ~/.bash_profile
        PATH="/usr/local/share/npm”
        PATH="path of android sdk up to tools folder : path of platform-tools in android sdk folder:$PATH".
      • For Ubuntu 
        $ sudo vi .bash_profile
        $ export PATH=$PATH:”/usr/local/share/npm”
        $ export PATH=$PATH:”path of tools folder from android sdk”
        $ export PATH=$PATH:”path of platform-tools folder from android sdk”
    • Before you can build the project, you need to specify a set of target platforms. Your ability to run these commands depends on whether your machine supports each SDK, and whether you have already installed each SDK. Run any of these from a MAC:
      • $ cordova platform add ios
      • $ cordova platform add amazon-fireos
      • $ cordova platform add android
      • $ cordova platform add blackberry10
      • $ cordova platform add firefox
    • Run any of these from a Windows machine, where wp refers to different versions of the Windows Phone operating system:
      • $ cordova platform add wp8
      • $ cordova platform add windows
      • $ cordova platform add amazon-fireos
      • $ cordova platform add android
      • $ cordova platform add blackberry10
      • $ cordova platform add firefoxos
    • Run this to check your current set of platforms:
      • $ cordova platforms ls
        (Note the platform and platforms commands are synonymous.)
    • Run either of the following synonymous commands to remove a platform:
      • $ cordova platform remove blackberry10
      • $ cordova platform rm amazon-fireos
      • $ cordova platform rm android
Roadmap For jUnite v3.0
Writing Mock APIs in PHP