CLI Utility that generates Cordova / Phonegap image assets required for app store submission, icons, and splash screens.
It requires your logo to have a solid background colour but does not distort or lose any image content so everything is at the maximum size without loss.
For a full copy/paste set for your config.xml see instructions.xml in the root of the source.
You need to have graphicsMagick installed before you can generate any assets (with homebrew installed on OSX):
$ brew install gm
with NodeJS installed:
$ npm install -g cordova-media-generator
Once installed, cd to the root of your Cordova application and run:
$ mediagen init
If you have created a
mediagen-config.json file (see below), you can just run:
This will overwrite all logos and splash screen images in the
<projectdir>/platforms directory with the correct sizes and in the correct location for Cordova (As at 3.5)
The recommended image or logo size is 2000px x 2000px. Its not a problem if the logo isn't square.
It also creates a
<projectdir>/Media directory that has images for the Apple and Android stores such as an app icon.
You can create additional custom images if you need to submit to alternative app stores or have other needs that we haven't thought of yet.
Simply go to your project directory and run
$ mediagen init
It will create an example file called
mediagen-config.json which you can now edit. Add as many or few files as you need to the array.
Note: The default path for files is the
<projectdir>/platformsdirectory, you might need to use
../as in the example below
"icon": "filename":"icon.png""background":"fff""splash": "filename":"splash.png""background":"fff""customImages":"width": 120 "height": 120 "path": "../Media/custom" "filename":"outputFilename.png" "source":"filename":"image.png""background":"fff""screenshots":"url":"" "name":"homepage"
The config variables are below:
v0.4.0 - Removed support for PhantomJS screenshots - they just weren't up to scratch. - Added support for Cordova 4 and moved to config.xml file setup instead of just replacing images in their place v0.3.6 - Added support for icon-60@3x, 667h Portrait, 736h Landscape, 736h Portrait v0.3.5 - Fix crash if no screenshots are specified