Local Cordova Development

Working with Cordova is usually pretty straightforward, the CLI is very flexible. However there are times where a developer might need to change some behavior in Cordova or apply a fix. In order to be able to apply patches on Cordova, first we have to uninstall it using NPM.

1
npm uninstall -g cordova

After removing cordova from global we need to install 3 repositories.

1
2
3
git clone git://git.apache.org/cordova-lib.git
git clone git://git.apache.org/cordova-cli.git
git clone git://git.apache.org/cordova-plugman.git

Assuming that we’ve installed the repo’s to c:\dev below are the final instructions for the setup:

1
2
3
4
5
6
7
8
cd c:\dev\cordova-lib\cordova-lib
npm install & npm link
cd ..\..\cordova-cli
npm link cordova-lib
npm install
cd ..\cordova-plugman
npm link cordova-lib
npm install

Now your local cordova installation should be ready. The last step is to add c:\dev\cordova-cli\bin to your PATH. After you’re done when you type in

1
cordova -v

it should display the latest dev version!