cordova-icon icon indicating copy to clipboard operation
cordova-icon copied to clipboard

Specify platform & folder to generate icons

Open loicknuchel opened this issue 10 years ago • 6 comments

Hi,

It would be nice if there is some parameters to specify wanted generated platform and output folder. In my case I locally build Android and I want to build iOS on phonegap build. So I have to provide Android and iOS icons in the www folder but as I only added Android, iOS icons are not generated :(

Thanks for all

loicknuchel avatar Jan 06 '15 13:01 loicknuchel

Same here.

tomchiverton avatar Jan 26 '15 13:01 tomchiverton

Same here. The iOS icons are being generated in the wrong folder as of the latest Cordova version. It should be in Resources/icons instead of Images.xcassets. Adding this option will help in case the folder path changes again in the future cordova versions.

ivywireline avatar Aug 16 '16 21:08 ivywireline

Maybe specify the file name too? I've used cordova-icon to generate notification icon for Android, but had to rename all generated images.

augustoabreu avatar Feb 13 '17 13:02 augustoabreu

I would only like to be able to specify the platform. File names and folder structures should be handled by this tool and it beeing kept up-to-date with cordova

nexorianus avatar Sep 12 '18 12:09 nexorianus

Hi everyone, I made a pullrequest which it can do this. [https://github.com/AlexDisler/cordova-icon/pull/130](pull request 130).

$ cordova-icon --iconspath=platforms/android/res/ --platforms=android
$ cordova-icon --platforms=ios:windows

I hope it helps, regards

alexkander avatar Nov 19 '18 21:11 alexkander

Another way to address this is to only generate for the platform targeted by the cordova prepare command. For example: cordova prepare ios ==> should only generate icons for ios cordova prepare android ==> should only generate icons for andriod cordova prepare ==> generates for both ios and android.

This can be fixed with a single line update to index.js (for each platform, android example below): isAdded : fs.existsSync('platforms/android') && process.env.CORDOVA_PLATFORMS.includes('android')

I do not have time right now to put this in a pull request, but I have tested this in my local installation.

farrisbar avatar Feb 10 '19 15:02 farrisbar