Skip to content

Instantly share code, notes, and snippets.

@bob-sims
Created July 26, 2012 02:10
Show Gist options
  • Save bob-sims/3179843 to your computer and use it in GitHub Desktop.
Save bob-sims/3179843 to your computer and use it in GitHub Desktop.
Automated Build of X-Platform Titanium Splash Screens and Icons
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png
# appicon-ios-512x512.png
# Default-320x480.png
# Default-Landscape-480x320.png
# Default-Landscape-800x480.png
# Default-Landscape-1024x768.png
# Default-Portrait-480x800.png
# Default-Portrait-768x1024.png
# [email protected]
echo "Enter the App Name"
read -e APPNAME
# go to the titanium project space – change this to your path
cd ~/Documents/Titanium\ Studio\ Workspace/
cd "$APPNAME"
mkdir ./Resources
mkdir ./Resources/iphone
mkdir ./Resources/android
mkdir ./Resources/android/images
mkdir ./Resources/android/images/res-long-port-hdpi
rm -rf ./Resources/android/images/res-long-port-hdpi/default.png
mkdir ./Resources/android/images/res-long-port-ldpi
rm -rf ./Resources/android/images/res-long-port-ldpi/default.png
mkdir ./Resources/android/images/res-notlong-port-hdpi
rm -rf ./Resources/android/images/res-notlong-port-hdpi/default.png
mkdir ./Resources/android/images/res-notlong-port-ldpi
rm -rf ./Resources/android/images/res-notlong-port-ldpi/default.png
mkdir ./Resources/android/images/res-notlong-port-mdpi
rm -rf ./Resources/android/images/res-notlong-port-mdpi/default.png
mkdir ./Resources/android/images/res-notlong-land-mdpi
rm -rf ./Resources/android/images/res-notlong-land-mdpi/default.png
mkdir ./Resources/android/images/res-notlong-land-ldpi
rm -rf ./Resources/android/images/res-notlong-land-ldpi/default.png
mkdir ./Resources/android/images/res-notlong-land-hdpi
rm -rf ./Resources/android/images/res-notlong-land-hdpi/default.png
mkdir ./Resources/android/images/res-long-land-ldpi
rm -rf ./Resources/android/images/res-long-land-ldpi/default.png
mkdir ./Resources/android/images/res-long-land-hdpi
rm -rf ./Resources/android/images/res-long-land-hdpi/default.png
convert -geometry 512x512 -quality 100 appicon-ios-512x512.png ./Resources/iphone/[email protected]
convert -geometry 114x114 -quality 100 appicon-ios-512x512.png ./Resources/iphone/[email protected]
convert -geometry 29x29 -quality 100 appicon-ios-512x512.png ./Resources/iphone/appicon-Small.png
convert -geometry 50x50 -quality 100 appicon-ios-512x512.png ./Resources/iphone/appicon-Small-50.png
convert -geometry 72x72 -quality 100 appicon-ios-512x512.png ./Resources/iphone/appicon-72.png
convert -geometry 57x57 -quality 100 appicon-ios-512x512.png ./Resources/iphone/appicon.png
convert -geometry 144x144 -quality 100 appicon-ios-512x512.png ./Resources/iphone/appicon-144.png
convert -geometry 128x128 -quality 100 appicon-android-512x512.png ./Resources/android/appicon.png
cp Default-320x480.png ./Resources/android/default.png
convert -crop 1024x748+0+20 -quality 100 Default-Landscape-1024x768.png ./Resources/iphone/Default-Landscape.png
convert -crop 768x1004+0+20 -quality 100 Default-Portrait-768x1024.png ./Resources/iphone/Default-Portrait.png
cp Default-320x480.png ./Resources/iphone/Default.png
cp [email protected] ./Resources/iphone/[email protected]
cp Default-Portrait-480x800.png ./Resources/android/images/res-long-port-hdpi/default.png
convert -geometry 240x400 -quality 100 Default-Portrait-480x800.png ./Resources/android/images/res-long-port-ldpi/default.png
cp Default-Portrait-480x800.png ./Resources/android/images/res-notlong-port-hdpi/default.png
convert -geometry 240x320 -quality 100 Default-Portrait-768x1024.png ./Resources/android/images/res-notlong-port-ldpi/default.png
cp Default-320x480.png ./Resources/android/images/res-notlong-port-mdpi/default.png
cp Default-Landscape-480x320.png ./Resources/android/images/res-notlong-land-mdpi/default.png
convert -geometry 320x240 -quality 100 Default-Landscape-1024x768.png ./Resources/android/images/res-notlong-land-ldpi/default.png
cp Default-Landscape-800x480.png ./Resources/android/images/res-notlong-land-hdpi/default.png
convert -geometry 400x240 -quality 100 Default-Landscape-800x480.png ./Resources/android/images/res-long-land-ldpi/default.png
cp Default-Landscape-800x480.png ./Resources/android/images/res-long-land-hdpi/default.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment