IMG-LOGO

How to list installed plugins in Cordova and how to add or uninstall an existing plugin?

andy - 21 Sep, 2017 9419 Views 0 Comment

If you are new to Cordova and about to learn to program your first mobile app. You might want to know how to install, remove or view plugins for your app. So why you do need a plugin? Plugins in cordova is considered as a component or a module created to be used to access Native API of your phone. For example if you need to access your phone camera, you will need a camera cordova plugin which is cordova-plugin-camera. There are heaps of available plugin created by developers, you just need to try and test them so it works according to your need.

Here are the list of commands you will learn on how to add, remove or view an existing plugin. Please note, you will require NodeJS in order to run those commands. To list available plugins available on your cordova mobile app, simply open a NodeJS command prompt and go to your mobile app project folder and type in the following command.

cordova plugin list

If you are using the latest Cordova, you can run this short command as well.

cordova plugins

To add a plugin into your cordova app, you can run the following command.

cordova plugin add plugin-name

//example
cordova plugin add cordova-plugin-whitelist

You can also install directly from github project if you want. You just need to pass the full path of the github url. See below example.

cordova plugin add https://github.com/apache/cordova-plugin-camera.git

To remove a plugin from your cordova app, you can run the following command.

cordova plugin remove cordova-plugin-camera

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.

Related Articles

Create your ebook android apps using Cordova Part 2

This is the second part tutorial of our first ebook cordova tutorial If you miss the first part of the tutorial I would recommend you to read the first tutorial before continue reading this article You can click the following ...

Create your ebook android apps using Cordova.

You will learn how to create your first android app using Cordova The ebook will consists of 5 basic pages and will use AngularJS for the navigation Slideout script for the menu navigation and Bootstrap template for the basic mobile ...