-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcreate_ios_icons.command
executable file
·211 lines (176 loc) · 7.41 KB
/
create_ios_icons.command
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/bin/sh
#このシェルスクリプトを実行した場所をカレントディレクトリにする(お約束)
cd `dirname $0`
# 出力ディレクトリの生成
outdir="ios"
mkdir -p $outdir
#----------------------------------------------------------------------
# iTunes Artwork アイコン
#----------------------------------------------------------------------
# iPhone6, iPhone6 Plus登場以降、全デバイスで1024x1024が必須となりました。↓
# https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
# ですので、このスクリプトでは最低でも、512x512サイズのアイコン画像がないと処理を終了するように修正しました。
# App icon for the App Store (すべてのアプリで必須)
if [ -e "icon_1024x1024.png" ]; then
if [ -e "icon_512x512.png" ]; then
echo "icon_512x512.png はすでに存在しています。処理をスキップします。"
BASE_FILE="icon_1024x1024.png"
else
sips -Z 512 icon_1024x1024.png --out icon_512x512.png
BASE_FILE="icon_1024x1024.png"
fi
fi
if [ -e "icon_512x512.png" ]; then
if [ -e "icon_1024x1024.png" ]; then
echo "icon_1024x1024.png はすでに存在しています。処理をスキップします。"
else
sips -Z 1024 icon_1024x1024.png --out icon_512x512.png
BASE_FILE="icon_512x512.png"
fi
else
echo "iTunes Artworkに設定できる適当なサイズが見つかりません。\niPhone6, iPhone6 Plus登場以降から、1024x1024が必須となりました。"
exit
fi
#----------------------------------------------------------------------
# アプリアイコン(ファイル名)
#----------------------------------------------------------------------
echo "BASE_ICON: "
echo ${BASE_FILE}
# iPhone Spotlight - iOS 5,6 推奨
# Settings - iOS 5-9 推奨
if [ -e "${outdir}/icon-small.png" ]; then
echo "icon-small.png はすでに存在しています。処理をスキップします。"
else
sips -Z 29 ${BASE_FILE} --out ${outdir}/icon-small.png
fi
# iPhone 6s,iPhone 6, and iPhone 5(@2x) 推奨
# iPhone 4s(@2x) 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 58 ${BASE_FILE} --out ${outdir}/[email protected]
fi
# iPhone 6s Plus and iPhone 6 Plus (@3x) 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 87 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPhone Spotlight iOS 7-9
# iPhone 5(@2x) 推奨
# iPhone 4s(@2x) 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 80 ${BASE_FILE} --out ${outdir}/[email protected]
fi
# iPhone 6s, iPhone 6(@2x) 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 120 ${BASE_FILE} --out ${outdir}/[email protected]
fi
# iPhone App iOS 5,6
if [ -e "${outdir}/icon.png" ]; then
echo "icon.png はすでに存在しています。処理をスキップします。"
else
sips -Z 57 ${BASE_FILE} --out ${outdir}/icon.png
fi
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 114 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
#iPhone App iOS 7-9
# iPhone 6s,iPhone 6, and iPhone 5(@2x) 必須
# iPhone 4s(@2x) 必須
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 120 ${BASE_FILE} --out ${outdir}/[email protected]
fi
# iPhone 6s Plus and iPhone 6 Plus (@3x) 必須
# iPhone 6s Plus and iPhone 6 Plus (@3x) Spotlight search results icon 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 180 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad Settings iOS 5-9
# iPad 2 and iPad mini(@1x) 推奨
if [ -e "${outdir}/icon-small.png" ]; then
echo "icon-small.png はすでに存在しています。処理をスキップします。"
else
sips -Z 29 ${BASE_FILE} --out ${outdir}/icon-small.png
fi
# iPad and iPad mini(@2x) 推奨
# iPad Pro(@2x) 推奨
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 58 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad Spotlight iOS 7-9
# iPad 2 and iPad mini(@1x) 推奨 ※ただしドキュメントでは120x120サイズとなっている。
if [ -e "${outdir}/icon-40.png" ]; then
echo "icon-40.png はすでに存在しています。処理をスキップします。"
else
sips -Z 40 ${BASE_FILE} --out ${outdir}/icon-40.png
fi
# iPad and iPad mini(@2x) 推奨 ※ただしドキュメントでは180x180サイズとなっている。
# iPad Pro(@2x) 推奨 ※ただしドキュメントでは180x180サイズとなっている。
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 80 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad Spotlight iOS 5,6
if [ -e "${outdir}/icon-50.png" ]; then
echo "icon-50.png はすでに存在しています。処理をスキップします。"
else
sips -Z 50 ${BASE_FILE} --out ${outdir}/icon-50.png
fi
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 100 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad App iOS 5,6
if [ -e "${outdir}/icon-72.png" ]; then
echo "icon-72.png はすでに存在しています。処理をスキップします。"
else
sips -Z 72 ${BASE_FILE} --out ${outdir}/icon-72.png
fi
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 144 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad App iOS 7-9
# iPad 2 and iPad mini(@1x) 必須
if [ -e "${outdir}/icon-76.png" ]; then
echo "icon-76.png はすでに存在しています。処理をスキップします。"
else
sips -Z 76 ${BASE_FILE} --out ${outdir}/icon-76.png
fi
# iPad and iPad mini(@2x) 必須
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 152 ${BASE_FILE} --out ${outdir}/[email protected]
fi
#----------------------------------------------------------------------
# iPad Pro App iOS 9
# iPad Pro(@2x) 必須
if [ -e "${outdir}/[email protected]" ]; then
echo "[email protected] はすでに存在しています。処理をスキップします。"
else
sips -Z 167 ${BASE_FILE} --out ${outdir}/[email protected]
fi