Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save already installed Cordova plugins to config.xml

Tags:

cordova

I have installed all my cordova plugins using the following syntax:

cordova plugin add <plugin-name>

I know (now) that if you add the --save flag to your install command, it will add your plugins to config.xml

cordova plugin add <plugin-name> --save

But, is there a lazy way to automatically add my already installed plugins to config.xml with something like this:

cordova plugin save-installed

If I am missing something obvious here, don't be shy to point me in the right direction.

like image 645
emccracken Avatar asked Sep 11 '15 08:09

emccracken


People also ask

How do I add a plugin to config xml cordova?

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.

Where is plugin xml in cordova?

The plugin. xml file is an XML document in the plugins namespace: http://apache.org/cordova/ns/plugins/1.0 .

How do I update cordova plugins in ionic?

Update Cordova Platforms versions are currently installed, run cordova platform list (If you are using Ionic, this information is also included in the ionic info output). This will return a list of “Installed platforms” with their version number: λ cordova platform list Installed platforms: android 5.0.

What is cordova plugin whitelist?

Controls which URLs the app is allowed to ask the system to open. Without any <allow-intent> tags, no requests to external URLs are allowed.


1 Answers

As reported in this cordova release post from cordova 5 you can add already installed plugins to config.xml using just one command:

cordova plugin save

This will save all previously installed plugins into your project’s config.xml.

You can check the latest cordova plugin documentation for more details.

If you need to do the same with the installed platforms, just run cordova platform save.

like image 166
lifeisfoo Avatar answered Sep 21 '22 15:09

lifeisfoo