5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Swiftで端末情報を取得するコード

Last updated at Posted at 2022-02-23

Swiftでスマホやタブレットの端末情報を取得する方法。

ソースコード

// UDID
UIDevice.current.identifierForVendor!.uuidString

// UUID
UUID().uuidString

// デバイス名
UIDevice.current.name

// システム名(iOSなど)
UIDevice.current.systemName

// システムバージョン(15.1など)
UIDevice.current.systemVersion

// キャリア名(ソフトバンク、ドコモなど)
CTTelephonyNetworkInfo().subscriberCellularProvider?.carrierName

// Mobile Country Code(MCC)(440など)
CTTelephonyNetworkInfo().subscriberCellularProvider?.mobileCountryCode

// Mobile Network Code(MNC)(10など)
CTTelephonyNetworkInfo().subscriberCellularProvider?.mobileNetworkCode

// ISO 3166 country codes(jpなど)
CTTelephonyNetworkInfo().subscriberCellularProvider?.isoCountryCode

参考

Swiftのお役立ち情報

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?