0

may anyone tell me how to remove all plugin of Cordova app by one command OS windows 10.

Sourabh
  • 644
  • 1
  • 7
  • 14
  • in which scenario is this needed? You can list all the plugins with `cordova plugins` and then remove them all using `cordova plugin rm cordova-plugin-1 cordova-plugin-2 ...`. Or create another app based on your assets using `cd .. && cordova create anotherApp --template=firstApp` (the latter will work if you don't have the plugins `save`d into `config.xml`). – daserge Jul 05 '16 at 07:04
  • I have 12 plugin in my app. I updated Android SDK 2 days back and just after that issue raised in building app. Perhaps one of them is creating issue. So I want to reinstall all of them. – Sourabh Jul 05 '16 at 07:10
  • 1
    Then you should probably delete them one by one and check if it fixes the build. – daserge Jul 05 '16 at 07:36
  • Possible duplicate of [Removing cordova plugins from the project](http://stackoverflow.com/questions/21932758/removing-cordova-plugins-from-the-project) – DaveAlden Dec 06 '16 at 13:41

1 Answers1

0

I would try making use of a Cordova hook script like this:

#!/usr/bin/env node

//this hook removes all your plugins

// add your plugins to this list--either 
// the identifier, the filesystem location 
// or the URL
var pluginlist = [
    "org.apache.cordova.device",
    "org.apache.cordova.device-motion",
    "org.apache.cordova.device-orientation",
    "org.apache.cordova.geolocation",
    "https://github.com/chrisekelley/AppPreferences/"
];

var fs = require('fs');
var path = require('path');
var sys = require('sys')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) {
    sys.puts(stdout)
}

pluginlist.forEach(function(plug) {
    exec("cordova plugin rm " + plug, puts);
});

Taken from @devgirlFL blog.

johnborges
  • 2,422
  • 20
  • 33