Differences between UDID and UUID

73,241

Solution 1

UUID (Universally Unique IDentifier) Is on a per-app basis. identifies an app on a device. As long as the user doesn’t completely delete the app, then this identifier will persist between app launches, and at least let you identify the same user using a particular app on a device. Unfortunately, if the user completely deletes and then reinstalls the app then the ID will change.

UDID (Unique Device Identifier) A sequence of 40 hexadecimal characters that uniquely identify an ios device. This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.

Solution 2

You better to go through this- http://nshipster.com/uuid-udid-unique-identifier/

UUID (Universally Unique Identifier): A sequence of 128 bits that can guarantee uniqueness across space and time, defined by RFC 4122.

UDID (Unique Device Identifier): A sequence of 40 hexadecimal characters that uniquely identify an iOS device (the device's Social Security Number, if you will). This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.

Solution 3

Apple is apparently starting to remove access to the UDID (Unique Device IDentifier) in iOS5. In any event, the best you can now do for identification purposes is to use a UUID (Universally Unique IDentifier). This has to be on a per-app basis. That is, there is no way to identify the device any longer, but you can identify an app on a device. As long as the user doesn’t completely delete the app, then this identifier will persist between app launches, and at least let you identify the same user using a particular app on a device. Unfortunately, if the user completely deletes and then reinstalls the app then the ID will change, but this is the best anyone can do going forward.

Solution 4

Since from iOS 5, Apple has deprecated the UIDevice uniqueIdentifier , that means traditional way of getting the unique id of each iOS device won't work now ie. [[UIDevice currentDevice] uniqueIdentifier] fails from iOS 5 and more.

So for the alternative to the UUID , we can use the CFUUID class of Apple in order to create unique id for device. But, we really need to keep in mind that this inbuild class will create random numbers so they will return different ids on every call. Don't use NSUserDefaults for storing it, best way is to use Keychain.

So, here I am giving you the best way of using it in order to use it as a unique key for your device.

- (NSString *)createNewUUID {

    CFUUIDRef theUUID = CFUUIDCreate(NULL);
    CFStringRef string = CFUUIDCreateString(NULL, theUUID);
    CFRelease(theUUID);
    return [(NSString *)string autorelease];
}

UDID:

http://whatsmyudid.com/

enter image description here

Solution 5

UDID, which is Unique Device Identifier, applied in iTunes, manage devices in your apple development certificate. it can be got by following code, in iOS5 SDK:

[UIDevice currentDevice] uniqueIdentifier];

define is:

@property(nonatomic,readonly,retain) NSString    *uniqueIdentifier  __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_5_0);  // a string unique to each device based on various hardware info.

UUID, which is Universally Unique Identifier, an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE)(wiki).

You can get UUID by following code:

-(NSString*) uuid {  
    CFUUIDRef puuid = CFUUIDCreate( nil );  
    CFStringRef uuidString = CFUUIDCreateString( nil, puuid );  
    NSString * result = (NSString *)CFStringCreateCopy( NULL, uuidString);  
    CFRelease(puuid);  
    CFRelease(uuidString);  
    return [result autorelease];  
}

But, in iOS7 device, above method will return the same value for difference device.

There are many methods to fetch unique identifiers in the link

Share:
73,241

Related videos on Youtube

Imran Qadir Baksh - Baloch
Author by

Imran Qadir Baksh - Baloch

Updated on July 09, 2022

Comments

  • Imran Qadir Baksh - Baloch
    Imran Qadir Baksh - Baloch almost 2 years

    Some people say UDID (Unique Device IDentifier) and some say UUID (Universally Unique IDentifier). Are they are the same or not? What are the differences between them?

    • Mars
      Mars over 6 years
      Did the duplicate question get modified? The duplicate question is not asking anything related, and the answer that it claims to have is buried and added on as an after thought marked with "(*)". Is it possible to remove duplicate tags? This one wasted a good 5 minutes of my time...
  • Spencer D
    Spencer D over 9 years
    As a small note, the picture you've attached is labeled saying "to get the UUID;" however, it's actually obtaining the UDID. I'm not expecting a fix, just wanted to jot that down so other readers will be aware.
  • Rahul Sharma
    Rahul Sharma almost 9 years
    how can i get UUID? and how many character in UUID and where it used basically
  • Rugmangathan
    Rugmangathan almost 9 years
    UUID is a 128bit character and UUID is represented by 32 lowercase hexadecimal digit. And you can get UUID by refering this SO Post stackoverflow.com/questions/14352418/…
  • Yi Jiang
    Yi Jiang over 8 years
    You need understand UUID is not UDID.
  • huync
    huync about 8 years
    The above image is incorrect, it show UDID, not UUID. UDID is unique string for each device ([[UIDevice currentDevice] uniqueIdentifier]). UUID is the random number, give you a random string every you create it (CFUUIDRef theUUID = CFUUIDCreate(NULL);).
  • early
    early almost 8 years
    image is correct, the note in red color by the author is not.
  • Jayprakash Dubey
    Jayprakash Dubey over 7 years
    @Rugmangathan : How to get UDID programmatically?
  • Rugmangathan
    Rugmangathan over 7 years
    @JayprakashDubey, No, you cannot get UDID anymore, instead you can use identifierForVendor(). For more follow this SO post stackoverflow.com/a/31652454/2849567
  • Mars
    Mars over 6 years
    UUID isn't on a per-app basis, it's a standard used for creating "unique" id's. identifierForVendor() is what you're referring to, which returns A UUID, but advertisingIdentifier is also a UUID.
  • Saif
    Saif about 4 years
    UUID does not persist between app launches, it generates a new identifier each time we call the method UUID().uuidString.