Cordova install platforms/plugins from config.xml

Vincent Wasteels picture Vincent Wasteels · Oct 13, 2015 · Viewed 17k times · Source

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 ?

Answer

daserge picture daserge · Oct 13, 2015

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.