Usually, people like to refer to the various identifiers as Device IDS, and I am also confused about the various identifiers and feel the need to comb through them. Whatever these identifiers are called, Apple will not allow developers to locate users’ devices, only apps, for privacy reasons.

IMEI

International Mobile Equipment Identity (IMEI) : The International Mobile device Identity (IMEI) is a globally unique number assigned to a Mobile phone after it is assembled. The iPhone only supports a single card, so the IMEI and iPhone are one-to-one.

IOS 2 provides a way to obtain an IMEI, but in order to protect user privacy, Apple no longer allows you to obtain an IMEI after iOS 5. If you obtain an IMEI from an app, you may be rejected by The Apple Store.

IDFA

Identifier for Identifier (IDFA) is an advertising Identifier. It is used for tracking users’ advertisements and is the unique ID of each device. IDFA is stored in the user’s system. Apple does not allow developers to track users’ devices, but in iOS 6 it provides a compromise to monitor the effectiveness of ads, but the IDFA will also change, such as resetting the system and restoring AD identifiers. Users will also be able to choose whether to disable AD tracking (i.e., no way for marketers to serve ads based on users’ behavioral preferences).

UDID

UDID (Unique Device Identifier) : The Unique Identifier of an Apple iOS Device. It has been banned by Apple since iOS 6 (May 2013).

The Mac address

Medium/Media Access Control (Mac) : indicates the physical address of a network device. If the IMEI is the unique identifier of the device, the Mac is the unique identifier of the network interface. If you have studied computer networks, you know that this is the Mac address that is used for physical addressing by IP.

Also due to privacy issues, after iOS 7, unique devices cannot be identified by Mac address, because the Mac address obtained after iOS 7 is a fixed value.

Medium-term summary

Developers tried their best to track users’ devices, but Apple forbade it, and after a game between the two sides, IDFA eventually ruled the world. The figure below comes from the network and clearly illustrates the evolution of Device ID.

Source network

NSUUID

Universally Unique IDentifier (UUID) : indicates the Universally Unique IDentifier

The NSUUID is the same as the CFUUID, just changed to an Objective-C interface. The NSUUID will change every time it gets a value, but it will remain unique.

NSString *uuid = [[NSUUID UUID] UUIDString];Copy the code

IDFV

IDFV (Identity FierforVendor) : Vendor identifier, also known as Vendor identifier. As long as all the apps of the current Vendor are not uninstalled on the user’s device, the change will not occur. What is a Vendor? It can be understood as the first two parts of a bundleID. For example, com.joy.app_1 and com.joy.app_2 belong to the same Vendor and share the same IDFV.

 NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];Copy the code

IDFV is suitable for tracking user behavior. Currently, IDFV is used with Keychain to ensure that IDFV remains unchanged regardless of whether it is uninstalled or reinstalled.

LC_UUID

This has nothing to do with a Device ID, but it’s also called a UUID so it doesn’t get confused. LC_UUID is used to indicate Mach-O. If you look at your APP’s crash log, you will find that the application’s executables and various libraries have their own UUID, and when you do symbol resolution, You need to find the same symbol file as the system library and your APP’s UUID to restore the stack address. The last column listed below is the UUID of the library or APP.

Binary Images:
0x107170000 - 0x1071aafff +GYMonitorExample x86_64 <f625eb41ccfa3c0db9ed70c4c083b101>
0x10724b000 - 0x107252fff libBacktraceRecording.dylib x86_64 <ad76d9937807307a8eb90279ce79d84e>
0x107259000 - 0x107260fff libViewDebuggerSupport.dylib x86_64 <f5c61d2ba3ab311ba5495a71e4f67790>
0x107269000 - 0x107548fff Foundation x86_64 <61cd1144bb933571bdb39f9b56cecffe>
0x10779c000 - 0x107b6bfff libobjc.A.dylib x86_64 <5f0e622c86ec3969acfbcaaa10e21a31>Copy the code

conclusion

In 2017 it was impossible to locate a user’s device by UDID, Mac address, OpenUDID, because they were either invalid or restricted by the App Store. But if you want to track ads, you can use IDFA. If you want to analyze user behavior, you can use IDFV + KeyChain.

NSUUID, IDFV, LC_UUID, NSUUID, IDFV, LC_UUID