-
Notifications
You must be signed in to change notification settings - Fork 0
/
iOSIconMaker.sh
66 lines (55 loc) · 1.31 KB
/
iOSIconMaker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!bin/bash
# author: Haocold
# date: 2018-11-05 14:40:29
echo "\n"
echo "============================"
echo "= ="
echo "= iOS Icon Maker ="
echo "= Made by Haocold ="
echo "= 2018-11-05 14:40:29 ="
echo "= ="
echo "============================"
echo "\n"
echo "Drag Icon png file into termimal...\n..."
echo "And then press Enter..."
echo ".\n..\n..."
echo "File path is:"
read input
echo ".\n..\n..."
# Create iPhone folder.
# %/* : is delete the last path component of 'input'
echo "mkdir 'iPhone' folder..."
cd ${input%/*}
mkdir iPhone
echo ".\n..\n..."
# Copy file to iPhone
echo "copy file..."
icon_file=${input##*/} # icon.png
cp -rf ${icon_file} iPhone
cd iPhone
# 1024 for App Store
cp ${icon_file} "1024x1024.png"
sips -z 1024 1024 "1024x1024.png"
# Icons for iPhone iPad
# 68x68
cp ${icon_file} "68x68@2x.png"
sips -z 136 136 "68x68@2x.png"
# 76x76
cp ${icon_file} "76x76@2x.png"
sips -z 152 152 "76x76@2x.png"
# 83.5x83.5
cp ${icon_file} "83.5x83.5@2x.png"
sips -z 167 167 "83.5x83.5@2x.png"
for name in 20 29 38 40 57 60 64
do
for scale in 2 3
do
new_name=${name}"x"${name}"@"${scale}"x.png"
echo $new_name
cp ${icon_file} $new_name
width=$[name * scale]
echo width is $width
sips -z $width $width $new_name
done
done
rm ${icon_file}