Module: Ios::Devices

Defined in:
lib/ios/devices.rb,
lib/ios/devices/model.rb,
lib/ios/devices/version.rb

Defined Under Namespace

Classes: Model

Constant Summary collapse

VERSION =
'0.3.3'

Class Method Summary collapse

Class Method Details

.search(device_type) ⇒ Object

Gets the official device for the given device type from the iOS devices.

Examples:

Ios::Devices.search('iPhone6,1')
=> #<Ios::Devices::Model:0x007fa55ba1a948 @extra=nil, @name="iPhone 5s", @name="iPhone6,1">

Ios::Devices.search('iPad2,2')
=> #<Ios::Devices::Model:0x007fa55b957308 @extra="GSM", @name="iPad 2", @name="iPad2,2">


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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/ios/devices.rb', line 19

def self.search(device_type)
  # This list was taken from here:
  # http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/ios-device-types
  case device_type
  when 'i386', 'x86_64', 'arm64'
    Model.new(device_type, 'iOS Simulator')
  when 'iPhone1,1'
    Model.new(device_type, 'iPhone')
  when 'iPhone1,2'
    Model.new(device_type, 'iPhone 3G')
  when 'iPhone2,1'
    Model.new(device_type, 'iPhone 3GS')
  when 'iPhone3,1'
    Model.new(device_type, 'iPhone 4', 'GSM')
  when 'iPhone3,2'
    Model.new(device_type, 'iPhone 4', 'GSM Rev A')
  when 'iPhone3,3'
    Model.new(device_type, 'iPhone 4', 'CDMA')
  when 'iPhone4,1'
    Model.new(device_type, 'iPhone 4S')
  when 'iPhone5,1', 'iPhone5,2'
    Model.new(device_type, 'iPhone 5')
  when 'iPhone5,3', 'iPhone5,4'
    Model.new(device_type, 'iPhone 5c')
  when 'iPhone6,1', 'iPhone6,2'
    Model.new(device_type, 'iPhone 5s')
  when 'iPhone7,1'
    Model.new(device_type, 'iPhone 6 Plus')
  when 'iPhone7,2'
    Model.new(device_type, 'iPhone 6')
  when 'iPhone8,1'
    Model.new(device_type, 'iPhone 6s')
  when 'iPhone8,2'
    Model.new(device_type, 'iPhone 6s Plus')
  when 'iPhone8,4'
    Model.new(device_type, 'iPhone SE')
  when 'iPhone9,1', 'iPhone9,3'
    Model.new(device_type, 'iPhone 7')
  when 'iPhone9,2', 'iPhone9,4'
    Model.new(device_type, 'iPhone 7 Plus')
  when 'iPhone10,1', 'iPhone10,4'
    Model.new(device_type, 'iPhone 8')
  when 'iPhone10,2', 'iPhone10,5'
    Model.new(device_type, 'iPhone 8 Plus')
  when 'iPhone10,3', 'iPhone10,6'
    Model.new(device_type, 'iPhone X')
  when 'iPhone11,2'
    Model.new(device_type, 'iPhone XS')
  when 'iPhone11,4', 'iPhone11,6'
    Model.new(device_type, 'iPhone XS Max')
  when 'iPhone11,8'
    Model.new(device_type, 'iPhone XR')
  when 'iPhone12,1'
    Model.new(device_type, 'iPhone 11')
  when 'iPhone12,3'
    Model.new(device_type, 'iPhone 11 Pro')
  when 'iPhone12,5'
    Model.new(device_type, 'iPhone 11 Pro Max')
  when 'iPhone12,8'
    Model.new(device_type, 'iPhone SE', '2nd gen')
  when 'iPhone13,1'
    Model.new(device_type, 'iPhone 12 Mini')
  when 'iPhone13,2'
    Model.new(device_type, 'iPhone 12')
  when 'iPhone13,3'
    Model.new(device_type, 'iPhone 12 Pro')
  when 'iPhone13,4'
    Model.new(device_type, 'iPhone 12 Pro Max')
  when 'iPhone14,2'
    Model.new(device_type, 'iPhone 13 Pro')
  when 'iPhone14,3'
    Model.new(device_type, 'iPhone 13 Pro Max')
  when 'iPhone14,4'
    Model.new(device_type, 'iPhone 13 Mini')
  when 'iPhone14,5'
    Model.new(device_type, 'iPhone 13')
  when 'iPhone14,6'
    Model.new(device_type, 'iPhone SE', '3rd gen')
  when 'iPhone14,7'
    Model.new(device_type, 'iPhone 14')
  when 'iPhone14,8'
    Model.new(device_type, 'iPhone 14 Plus')
  when 'iPhone15,2'
    Model.new(device_type, 'iPhone 14 Pro')
  when 'iPhone15,3'
    Model.new(device_type, 'iPhone 14 Pro Max')
  when 'iPhone15,4'
    Model.new(device_type, 'iPhone 15')
  when 'iPhone15,5'
    Model.new(device_type, 'iPhone 15 Plus')
  when 'iPhone16,1'
    Model.new(device_type, 'iPhone 15 Pro')
  when 'iPhone16,2'
    Model.new(device_type, 'iPhone 15 Pro Max')
  when 'iPad1,1'
    Model.new(device_type, 'iPad')
  when 'iPad1,2'
    Model.new(device_type, 'iPad', '3G')
  when 'iPad2,1'
    Model.new(device_type, 'iPad 2', 'Wi-Fi')
  when 'iPad2,2'
    Model.new(device_type, 'iPad 2', 'GSM')
  when 'iPad2,3'
    Model.new(device_type, 'iPad 2', 'CDMA')
  when 'iPad2,4'
    Model.new(device_type, 'iPad 2', 'Wi-Fi, revised')
  when 'iPad2,5'
    Model.new(device_type, 'iPad mini', 'Wi-Fi')
  when 'iPad2,6', 'iPad2,7'
    Model.new(device_type, 'iPad mini')
  when 'iPad3,1'
    Model.new(device_type, 'iPad', '3rd gen, Wi-Fi')
  when 'iPad3,2'
    Model.new(device_type, 'iPad', '3rd gen, Wi-Fi+LTE Verizon')
  when 'iPad3,3'
    Model.new(device_type, 'iPad', '3rd gen, Wi-Fi+LTE AT&T')
  when 'iPad3,4'
    Model.new(device_type, 'iPad', '4th gen, Wi-Fi')
  when 'iPad3,5', 'iPad3,6'
    Model.new(device_type, 'iPad', '4th gen')
  when 'iPad4,1'
    Model.new(device_type, 'iPad Air', 'Wi-Fi')
  when 'iPad4,2'
    Model.new(device_type, 'iPad Air', 'Wi-Fi+LTE')
  when 'iPad4,3'
    Model.new(device_type, 'iPad Air', 'Rev')
  when 'iPad4,4'
    Model.new(device_type, 'iPad mini 2', 'Wi-Fi')
  when 'iPad4,5'
    Model.new(device_type, 'iPad mini 2', 'Wi-Fi+LTE')
  when 'iPad4,6'
    Model.new(device_type, 'iPad mini 2', 'Rev')
  when 'iPad4,7'
    Model.new(device_type, 'iPad mini 3', 'Wi-Fi')
  when 'iPad4,8', 'iPad4,9'
    Model.new(device_type, 'iPad mini 3')
  when 'iPad5,1'
    Model.new(device_type, 'iPad mini 4', 'Wi-Fi')
  when 'iPad5,2'
    Model.new(device_type, 'iPad mini 4', 'Wi-Fi+LTE')
  when 'iPad5,3'
    Model.new(device_type, 'iPad Air 2', 'Wi-Fi')
  when 'iPad5,4'
    Model.new(device_type, 'iPad Air 2', 'Wi-Fi+LTE')
  when 'iPad6,3'
    Model.new(device_type, 'iPad Pro 9.7"', 'Wi-Fi')
  when 'iPad6,4'
    Model.new(device_type, 'iPad Pro 9.7"', 'Wi-Fi+LTE')
  when 'iPad6,7'
    Model.new(device_type, 'iPad Pro 12.9"', 'Wi-Fi')
  when 'iPad6,8'
    Model.new(device_type, 'iPad Pro 12.9"', 'Wi-Fi+LTE')
  when 'iPad6,11'
    Model.new(device_type, 'iPad', '5th gen, Wi-Fi')
  when 'iPad6,12'
    Model.new(device_type, 'iPad', '5th gen, Wi-Fi+LTE')
  when 'iPad7,1'
    Model.new(device_type, 'iPad Pro 12.9"', '2nd gen, Wi-Fi')
  when 'iPad7,2'
    Model.new(device_type, 'iPad Pro 12.9"', '2nd gen, Wi-Fi+LTE')
  when 'iPad7,3'
    Model.new(device_type, 'iPad Pro 10.5"', 'Wi-Fi')
  when 'iPad7,4'
    Model.new(device_type, 'iPad Pro 10.5"', 'Wi-Fi+LTE')
  when 'iPad7,5'
    Model.new(device_type, 'iPad', '6th gen, Wi-Fi')
  when 'iPad7,6'
    Model.new(device_type, 'iPad', '6th gen, Wi-Fi+LTE')
  when 'iPad7,11'
    Model.new(device_type, 'iPad 10.2"', '7th gen, Wi-Fi')
  when 'iPad7,12'
    Model.new(device_type, 'iPad 10.2"', '7th gen, Wi-Fi+LTE')
  when 'iPad8,1'
    Model.new(device_type, 'iPad Pro 11"', 'Wi-Fi')
  when 'iPad8,2'
    Model.new(device_type, 'iPad Pro 11"', 'Wi-Fi')
  when 'iPad8,3'
    Model.new(device_type, 'iPad Pro 11"', 'Wi-Fi+LTE')
  when 'iPad8,4'
    Model.new(device_type, 'iPad Pro 11"', 'Wi-Fi+LTE')
  when 'iPad8,5'
    Model.new(device_type, 'iPad Pro 12.9"', '3rd gen, Wi-Fi')
  when 'iPad8,6'
    Model.new(device_type, 'iPad Pro 12.9"', '3rd gen, Wi-Fi')
  when 'iPad8,7'
    Model.new(device_type, 'iPad Pro 12.9"', '3rd gen, Wi-Fi+LTE')
  when 'iPad8,8'
    Model.new(device_type, 'iPad Pro 12.9"', '3rd gen, Wi-Fi+LTE')
  when 'iPad8,9'
    Model.new(device_type, 'iPad Pro 11"', '2nd gen, Wi-Fi')
  when 'iPad8,10'
    Model.new(device_type, 'iPad Pro 11"', '2nd gen, Wi-Fi+LTE')
  when 'iPad8,11'
    Model.new(device_type, 'iPad Pro 12.9"', '4th gen, Wi-Fi')
  when 'iPad8,12'
    Model.new(device_type, 'iPad Pro 12.9"', '4th gen, Wi-Fi+LTE')
  when 'iPad11,1'
    Model.new(device_type, 'iPad mini 5', 'Wi-Fi')
  when 'iPad11,2'
    Model.new(device_type, 'iPad mini 5', 'Wi-Fi+LTE')
  when 'iPad11,3'
    Model.new(device_type, 'iPad Air 3', 'Wi-Fi')
  when 'iPad11,4'
    Model.new(device_type, 'iPad Air 3', 'Wi-Fi+LTE')
  when 'iPad11,6'
    Model.new(device_type, 'iPad', '8th gen, Wi-Fi')
  when 'iPad11,7'
    Model.new(device_type, 'iPad', '8th gen, Wi-Fi+LTE')
  when 'iPad12,1'
    Model.new(device_type, 'iPad', '9th gen, Wi-Fi')
  when 'iPad12,2'
    Model.new(device_type, 'iPad', '9th gen, Wi-Fi+LTE')
  when 'iPad13,1'
    Model.new(device_type, 'iPad Air 4', 'Wi-Fi')
  when 'iPad13,2'
    Model.new(device_type, 'iPad Air 4', 'Wi-Fi+LTE')
  when 'iPad13,4'
    Model.new(device_type, 'iPad Pro 11"', '3rd gen, Wi-Fi')
  when 'iPad13,5', 'iPad13,6', 'iPad13,7'
    Model.new(device_type, 'iPad Pro 11"', '3rd gen, Wi-Fi+LTE')
  when 'iPad13,8'
    Model.new(device_type, 'iPad Pro 12.9"', '5th gen, Wi-Fi')
  when 'iPad13,9', 'iPad13,10', 'iPad13,11'
    Model.new(device_type, 'iPad Pro 12.9"', '5th gen, Wi-Fi+LTE')
  when 'iPad13,16'
    Model.new(device_type, 'iPad Air', '5th gen, Wi-Fi')
  when 'iPad13,17'
    Model.new(device_type, 'iPad Air', '5th gen, Wi-Fi+LTE')
  when 'iPad13,18'
    Model.new(device_type, 'iPad', '10th gen, Wi-Fi')
  when 'iPad13,19'
    Model.new(device_type, 'iPad', '10th gen, Wi-Fi+LTE')
  when 'iPad14,1'
    Model.new(device_type, 'iPad mini 6', 'Wi-Fi')
  when 'iPad14,2'
    Model.new(device_type, 'iPad mini 6', 'Wi-Fi+LTE')
  when 'iPad14,3'
    Model.new(device_type, 'iPad Pro 11"', '4th Gen, Wi-Fi')
  when 'iPad14,4'
    Model.new(device_type, 'iPad Pro 11"', '4th Gen, Wi-Fi+LTE')
  when 'iPad14,5'
    Model.new(device_type, 'iPad Pro 12.9"', '6th Gen, Wi-Fi')
  when 'iPad14,6'
    Model.new(device_type, 'iPad Pro 12.9"', '6th Gen, Wi-Fi+LTE')
  when 'iPod1,1'
    Model.new(device_type, 'iPod touch')
  when 'iPod2,1'
    Model.new(device_type, 'iPod touch', '2nd gen')
  when 'iPod3,1'
    Model.new(device_type, 'iPod touch', '3rd gen')
  when 'iPod4,1'
    Model.new(device_type, 'iPod touch', '4th gen')
  when 'iPod5,1'
    Model.new(device_type, 'iPod touch', '5th gen')
  when 'iPod7,1'
    Model.new(device_type, 'iPod touch', '6th gen')
  when 'iPod9,1'
    Model.new(device_type, 'iPod touch', '7th gen')
  when 'Watch1,1'
    Model.new(device_type, 'Apple Watch', '38mm')
  when 'Watch1,2'
    Model.new(device_type, 'Apple Watch', '42mm')
  when 'Watch2,6'
    Model.new(device_type, 'Apple Watch', 'Series 1, 38mm')
  when 'Watch2,7'
    Model.new(device_type, 'Apple Watch', 'Series 1, 42mm')
  when 'Watch2,3'
    Model.new(device_type, 'Apple Watch', 'Series 2, 38mm')
  when 'Watch2,4'
    Model.new(device_type, 'Apple Watch', 'Series 2, 42mm')
  when 'Watch3,1'
    Model.new(device_type, 'Apple Watch', 'Series 3, 38mm, GPS+Cellular')
  when 'Watch3,2'
    Model.new(device_type, 'Apple Watch', 'Series 3, 42mm, GPS+Cellular')
  when 'Watch3,3'
    Model.new(device_type, 'Apple Watch', 'Series 3, 38mm, GPS')
  when 'Watch3,4'
    Model.new(device_type, 'Apple Watch', 'Series 3, 42mm, GPS')
  when 'Watch4,1'
    Model.new(device_type, 'Apple Watch', 'Series 4, 40mm, GPS')
  when 'Watch4,2'
    Model.new(device_type, 'Apple Watch', 'Series 4, 44mm, GPS')
  when 'Watch4,3'
    Model.new(device_type, 'Apple Watch', 'Series 4, 40mm, GPS+Cellular')
  when 'Watch4,4'
    Model.new(device_type, 'Apple Watch', 'Series 4, 44mm, GPS+Cellular')
  when 'Watch5,1'
    Model.new(device_type, 'Apple Watch', 'Series 5, 40mm, GPS')
  when 'Watch5,2'
    Model.new(device_type, 'Apple Watch', 'Series 5, 44mm, GPS')
  when 'Watch5,3'
    Model.new(device_type, 'Apple Watch', 'Series 5, 40mm, GPS+Cellular')
  when 'Watch5,4'
    Model.new(device_type, 'Apple Watch', 'Series 5, 44mm, GPS+Cellular')
  when 'Watch5,9'
    Model.new(device_type, 'Apple Watch', 'SE, 40mm, GPS')
  when 'Watch5,10'
    Model.new(device_type, 'Apple Watch', 'SE, 44mm, GPS')
  when 'Watch5,11'
    Model.new(device_type, 'Apple Watch', 'SE, 40mm, GPS+Cellular')
  when 'Watch5,12'
    Model.new(device_type, 'Apple Watch', 'SE, 44mm, GPS+Cellular')
  when 'Watch6,1'
    Model.new(device_type, 'Apple Watch', 'Series 6, 40mm, GPS')
  when 'Watch6,2'
    Model.new(device_type, 'Apple Watch', 'Series 6, 44mm, GPS')
  when 'Watch6,3'
    Model.new(device_type, 'Apple Watch', 'Series 6, 40mm, GPS+Cellular')
  when 'Watch6,4'
    Model.new(device_type, 'Apple Watch', 'Series 6, 44mm, GPS+Cellular')
  when 'Watch6,6'
    Model.new(device_type, 'Apple Watch', 'Series 7, 41mm, GPS')
  when 'Watch6,7'
    Model.new(device_type, 'Apple Watch', 'Series 7, 45mm, GPS')
  when 'Watch6,8'
    Model.new(device_type, 'Apple Watch', 'Series 7, 41mm, GPS+Cellular')
  when 'Watch6,9'
    Model.new(device_type, 'Apple Watch', 'Series 7, 45mm, GPS+Cellular')
  when 'Watch6,10'
    Model.new(device_type, 'Apple Watch', 'SE 2, 40mm, GPS')
  when 'Watch6,10'
    Model.new(device_type, 'Apple Watch', 'SE 2, 40mm, GPS')
  when 'Watch6,11'
    Model.new(device_type, 'Apple Watch', 'SE 2, 44mm, GPS')
  when 'Watch6,12'
    Model.new(device_type, 'Apple Watch', 'SE 2, 40mm, GPS+Cellular')
  when 'Watch6,13'
    Model.new(device_type, 'Apple Watch', 'SE 2, 44mm, GPS+Cellular')
  when 'Watch6,14'
    Model.new(device_type, 'Apple Watch', 'Series 8, 41mm, GPS')
  when 'Watch6,15'
    Model.new(device_type, 'Apple Watch', 'Series 8, 45mm, GPS')
  when 'Watch6,16'
    Model.new(device_type, 'Apple Watch', 'Series 8, 41mm, GPS+Cellular')
  when 'Watch6,17'
    Model.new(device_type, 'Apple Watch', 'Series 8, 45mm, GPS+Cellular')
  when 'Watch6,18'
    Model.new(device_type, 'Apple Watch', 'Ultra')
  when 'Watch7,1'
    Model.new(device_type, 'Apple Watch', 'Series 9, 41mm, GPS')
  when 'Watch7,2'
    Model.new(device_type, 'Apple Watch', 'Series 9, 45mm, GPS')
  when 'Watch7,3'
    Model.new(device_type, 'Apple Watch', 'Series 9, 41mm, GPS+Cellular')
  when 'Watch7,4'
    Model.new(device_type, 'Apple Watch', 'Series 9, 45mm, GPS+Cellular')
  when 'Watch7,5'
    Model.new(device_type, 'Apple Watch', 'Ultra 2')
  else
    Model.new(device_type, UNKNOWN_IOS_DEVICE)
  end
end