Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.
/ Devices Public archive

Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. Useful when needing to parse machine/device identifier (i.e. iPhone10,1) to device name (iPhone 8).

License

Notifications You must be signed in to change notification settings

ptrkstr/Devices

Repository files navigation

🚨 No Longer Maintained 🚨

  • The website this depends on has changed, breaking the daily CI check.
  • Some time would be needed to figure out the issue.
  • This is a project with no sponsorship and so I don't have time to fix things breaking.

Devices



Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. A common use case is wanting to convert device identifiers (also known as machine identifiers) such as iPhone10,1 to a user friendly name; iPhone 8.

Features

  • All Apple Devices
    • 🎧 AirPods
    • ⚪️ AirTags
    • 📺 AppleTVs
      • SiriRemotes
    • ⌚️ Apple Watches
    • 🏠 HomePods
    • 🔲 iPads
      • ✏️ Apple Pencils
      • ⌨️ Smart Keyboard
    • 📱 iPhones
    • 📱 iPod Touches
    • 💻 Macs
  • 📝 Provides device information on:
    • Generation - iPhone XR
    • Bootroom - Bootrom 3865.0.0.4.7
    • Internal Name - N841AP
    • Identifier - iPhone11,8
    • Storage - 64 GB
    • Color/Finish - Black
    • Model - MRY42
    • more!
  • 🕒 Checks for new devices every day.
  • 🔌 No networking, runs offline.

Usage

Each device has an all property. Use this to find, filter, map etc. The following are some examples.

Find the generation of current device

let identifier = "iPad3,6"
let iPhone = iPhone.all.first { $0.identifier == identifier }
iPhone.generation // iPad (4th generation)

Find the generation of current device using subscript

let identifier = "iPad3,6"
let iPhone = DeviceList().all[identifer].first!
iPhone.generation // iPad (4th generation)

List all available colors of the iPad Air 2 64 GB

let colors = iPadAir.all.filter {
    $0.generation == "iPad Air 2" &&
    $0.storage == "64 GB"
}.map { $0.finish }
Set(colors).sorted() // ["Gold", "Silver", "Space Gray"]

List all Apple Watch Identifiers

let identifiers = AppleWatch.all.map { $0.identifier }
Set(identifiers).sorted() // ["Watch1,1", "Watch1,2", "Watch2,3", ...]

List all models of the iPad mini 2, iPad4,5, Silver 16 GB

let iPad = iPadMini.all.first {
    $0.identifier == "iPad4,5" &&
    $0.finish == "Silver" &&
    $0.storage == "16 GB"
}!
iPad.model.components(separatedBy: ", ") // ["ME814", "ME818", "MF074", "MF075", "MF076", "MF544"]

See FAQ for why Set is used in some examples.

Installation

SPM

Add the following to your project:

https://github.com/ptrkstr/Devices

FAQ

What are the list of devices and properties I can access?

You can see them by going to Types.

Why can I see duplicated devices? I.e. iPad Air has 3 sets of Silver 16 GB.

That's because a lot of device models are released slightly differently depending on the region i.e. in China, iPhones can come with two sim card slots as opposed to western regions which either include 1 slot [and an esim]. Those different devices tend to have a different "A" number, FCC ID, Identifier and Model. If you're performing searches for Finish/Color or Storage, you may want to remove duplicates.

Why are some of the returned values a question mark or Unknown?

The data may not (yet) be available.

How can I split values that contains commas or newlines?

The model field sometimes contains multiple model names. These can be split with .model.components(separatedBy: ", ") The identifier field sometimes contains multiple identifiers. These can be split with .identifier.components(separatedBy: "\n")

How quickly will this update when Apple releases new devices?

A check is run every day to see if this list of devices has changed. If so, a pull request is raised and I'll be notified to review it. You can expect a delay of a few days at the very most.

Alternatives

About

Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. Useful when needing to parse machine/device identifier (i.e. iPhone10,1) to device name (iPhone 8).

Resources

License

Stars

Watchers

Forks