Vincent Wasteels
Vincent Wasteels

Reputation: 1588

Cordova install platforms/plugins from config.xml

In Cordova, it is possible to save platforms and plugins into the config.xml file, this way :

cordova platform add <platform> --save
cordova plugin add <plugin> --save

This is usefull for versioning in order to not commit all this generated files.

But... how can I install them back from config.xml ?

Something like : cordova platform add --source=config.xml ?

Upvotes: 22

Views: 20241

Answers (4)

Lakshay Sharma
Lakshay Sharma

Reputation: 1

Run the command in your dir of outside www folder

$ cordova platform add ios - for adding ios platform
$ cordova platform add android- for adding android platform
$ cordova platform add blackberry10
$ cordova platform add firefoxos

Upvotes: 0

Adam
Adam

Reputation: 1975

To install all plugins from the config.xml file you run:

cordova prepare

Check what plugins are loaded with:

cordova plugin list

Upvotes: 10

daserge
daserge

Reputation: 1512

Upd: Official docs on this topic: http://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/index.html

Here is some docs on this feature from Tools Release: April 21, 2015:

When adding plugins or platforms, use the --save flag to add them to config.xml.

Ex: cordova platform add android --save.

Existing projects can use cordova plugin save and cordova platform save commands to save all previously installed plugins and platforms into your project's config.xml.

Platforms and plugins will be autorestored when cordova prepare is run. This allows developers to easily manage and share their dependenceis among different development enviroments and with their coworkers.

Upvotes: 35

Vincent Wasteels
Vincent Wasteels

Reputation: 1588

Apparently running a command like cordova serve will automatically add all missing platforms/plugins !

Upvotes: 1

Related Questions