Automatic icon resizing for Cordova. Add icon.png
to the root folder of your Cordova project and use cordova-icon-gm to automatically resize, copy and configure the icon for all current Android and iOS devices.
npm install -g cordova-icon-gm
- Place
icon.png
to the root folder of your Cordova project - Run
cordova-icon
.
-
npm install cordova-icon-gm --save-dev
-
Create
my-icon-hook.js
var icon = require('cordova-icon-gm'); module.exports = function() { return icon.generate(); };
-
Add hook to
config.xml
<hook src="my-icon-hook.js" type="after_platform_add" />
That's it. Now every time you cordova add platform
, the icons will be auto generated.
- GraphicsMagick
- At least one platform was added to your project
- Cordova's config.xml file must exist in the root folder
All credit goes to Alex Disler for his cordova-icon module, from which this project is forked from. The node imagemagick module is deprecated in favor of gm.
MIT