Created
April 1, 2015 17:32
-
-
Save badgercl/63847551595431586f19 to your computer and use it in GitHub Desktop.
Script to create Android App icon assets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #LDPI should be 36 x 36. | |
| #MDPI should be 48 x 48. | |
| #TVDPI should be 64 x 64. | |
| #HDPI should be 72 x 72. | |
| #XHDPI should be 96 x 96. | |
| #XXHDPI should be 144 x 144. | |
| #XXXHDPI should be 192 x 192. | |
| ## format_names and formats MUST have the same length | |
| format_names=("ldpi" "mdpi" "tvdpi" "hdpi" "xhdpi" "xxhdpi" "xxxhdpi") | |
| formats=(36 48 64 72 96 144 192) | |
| total=${#formats[*]} | |
| for ((i=0; i<=$((total-1)); i++)) | |
| do | |
| mkdir drawable-${format_names[$i]} | |
| cp base.png ./drawable-${format_names[$i]}/ic_launcher.png | |
| sips -Z ${formats[$i]} ./drawable-${format_names[$i]}/ic_launcher.png | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment