Difference between revisions of "UDID"

From The iPhone Wiki
Jump to: navigation, search
m (Link fix)
(Details of new format)
Line 1: Line 1:
  +
A '''UDID''' (Unique Device Identifier) is a calculated string that is used to identify a device for the purposes of app installation, registration, and MDM enrollment.
'''UDID''' is short for '''U'''nique '''D'''evice '''Id'''entifier. It is a 40-character long hex value (20 bytes). You can easily find out a device's UDID in [[iTunes]], when the device is connected, by clicking on '''Serial Number'''.
 
 
You might hear about UDIDs because developers registered with Apple can list up to 100 unique devices that can test their apps, and they list these permitted devices by listing their UDIDs.
 
   
 
For developers building extensions for jailbroken iOS: it's not recommended to calculate the UDID yourself - instead, use [http://iphonedevwiki.net/index.php/LibMobileGestalt.dylib libMobileGestalt.dylib, as described on the iPhoneDevWiki].
 
For developers building extensions for jailbroken iOS: it's not recommended to calculate the UDID yourself - instead, use [http://iphonedevwiki.net/index.php/LibMobileGestalt.dylib libMobileGestalt.dylib, as described on the iPhoneDevWiki].
   
 
== Calculation ==
 
== Calculation ==
  +
There are two different formats of UDID, depending on the device.
The [[UDID]] is being calculated like this:
 
*Create a 60-character long or 59-character long (on newer devices) text string (see below)
 
*Calculate the [[wikipedia:SHA-1|SHA1]] hash of the text string. The result is the [[UDID]].
 
   
  +
===[[Apple Watch Series 4]], [[iPhone XR]], [[iPhone XS]], [[iPhone XS Max]]===
To create the text string, append the following four strings:
 
  +
With the release of [[Apple Watch Series 4]], [[iPhone XR]], [[iPhone XS]], [[iPhone XS Max]], the UDID format has changed. It is now the following:
*11-character long or 12-character long (on newer devices) '''serial number''' (exactly like it is written in the Settings app)
 
  +
#Four zeros, followed by the [[CHIP]], without leading zeros. e.g. <code>8020</code> for [[iPhone XS]].
*one of these:
 
  +
#A hyphen, followed by another two zeros.
**(on older devices) 15-character long '''IMEI number''' (without spaces); empty string for iPod touch and Wi-Fi model iPads
 
  +
#The device's ECID in hexadecimal.
**(on newer devices) 13-character long '''ECID''' in decimal, no leading zeroes
 
*17-character long '''Wi-Fi MAC address''' (letters in lower case, including colons); for the [[N45AP|iPod touch first generation]] use "00:00:00:00:00:00"
 
*17-character long '''Bluetooth MAC address''' (letters in lower case, including colons)
 
   
  +
The general format will be:
=== In short ===
 
  +
0000CHIP-00ECID
On the [[N92AP|Verizon iPhone 4]] and newer:
 
  +
  +
===All other devices===
  +
For all [[Apple TV]]s, [[Apple Watch Series 3]] and earlier, all [[iPad]]s, all [[iPad mini]]s, [[iPhone X]] and earlier, and all [[iPod touch]], the method to calculate is the following:
  +
  +
#Get the 11- or 12-character long '''serial number''' (exactly like it is written in the Settings app)
  +
#On [[iPhone 4]] and newer, get the '''ECID''' in decimal, no leading zeroes. On earlier devices, get the '''IMEI number''' (without spaces, empty string for iPod touch and Wi-Fi model iPads)
  +
#Get the '''Wi-Fi MAC address''' (letters in lower case, including colons); for the [[N45AP|iPod touch first generation]] use "00:00:00:00:00:00"
  +
#Get the '''Bluetooth MAC address''' (letters in lower case, including colons)
  +
#Calculate a SHA1 hash of these.
  +
  +
The basic formula for this is below:
  +
On the [[N92AP|Verizon iPhone 4]] up to [[iPhone X]] (inclusive):
 
UDID = SHA1(serial + ECID + wifiMac + bluetoothMac)
 
UDID = SHA1(serial + ECID + wifiMac + bluetoothMac)
   
  +
Prior devices:
All else:
 
 
UDID = SHA1(serial + IMEI + wifiMac + bluetoothMac)
 
UDID = SHA1(serial + IMEI + wifiMac + bluetoothMac)
   
== Changing UDID ==
+
==== Changing UDID ====
  +
This form of UDID can be changed by running the command below, followed by a DFU restore. If the DFU restore is not performed, many applications will break, including iTunes. '''It is very important to first write down the original MAC address and keep that information in a safe place so that you can revert this change if necessary.''' This hack is shown on an [http://twitpic.com/9015lw iPod touch (4th generation)].
 
The UDID can be changed by running the command below, followed by a DFU restore. If the DFU restore is not performed, many applications will break, including iTunes. '''It is very important to first write down the original MAC address and keep that information in a safe place so that you can revert this change if necessary.''' This hack is shown on an [http://twitpic.com/9015lw iPod touch (4th generation)].
 
   
 
'''It is also very important to not change this to an invalid MAC address.''' If you change your device's MAC address to something invalid, your internet won't work again until you fix the MAC address (using MobileTerminal or similar). This persists even if you restore -- so you can make this really really hard to fix (you can call it a form of [[bricked|bricking]]) if you restore and there's no jailbreak available, if the available jailbreaks don't include afc2 and other workarounds aren't working.
 
'''It is also very important to not change this to an invalid MAC address.''' If you change your device's MAC address to something invalid, your internet won't work again until you fix the MAC address (using MobileTerminal or similar). This persists even if you restore -- so you can make this really really hard to fix (you can call it a form of [[bricked|bricking]]) if you restore and there's no jailbreak available, if the available jailbreaks don't include afc2 and other workarounds aren't working.

Revision as of 18:16, 29 September 2018

A UDID (Unique Device Identifier) is a calculated string that is used to identify a device for the purposes of app installation, registration, and MDM enrollment.

For developers building extensions for jailbroken iOS: it's not recommended to calculate the UDID yourself - instead, use libMobileGestalt.dylib, as described on the iPhoneDevWiki.

Calculation

There are two different formats of UDID, depending on the device.

Apple Watch Series 4, iPhone XR, iPhone XS, iPhone XS Max

With the release of Apple Watch Series 4, iPhone XR, iPhone XS, iPhone XS Max, the UDID format has changed. It is now the following:

  1. Four zeros, followed by the CHIP, without leading zeros. e.g. 8020 for iPhone XS.
  2. A hyphen, followed by another two zeros.
  3. The device's ECID in hexadecimal.

The general format will be:

0000CHIP-00ECID

All other devices

For all Apple TVs, Apple Watch Series 3 and earlier, all iPads, all iPad minis, iPhone X and earlier, and all iPod touch, the method to calculate is the following:

  1. Get the 11- or 12-character long serial number (exactly like it is written in the Settings app)
  2. On iPhone 4 and newer, get the ECID in decimal, no leading zeroes. On earlier devices, get the IMEI number (without spaces, empty string for iPod touch and Wi-Fi model iPads)
  3. Get the Wi-Fi MAC address (letters in lower case, including colons); for the iPod touch first generation use "00:00:00:00:00:00"
  4. Get the Bluetooth MAC address (letters in lower case, including colons)
  5. Calculate a SHA1 hash of these.

The basic formula for this is below: On the Verizon iPhone 4 up to iPhone X (inclusive):

UDID = SHA1(serial + ECID + wifiMac + bluetoothMac)

Prior devices:

UDID = SHA1(serial + IMEI + wifiMac + bluetoothMac)

Changing UDID

This form of UDID can be changed by running the command below, followed by a DFU restore. If the DFU restore is not performed, many applications will break, including iTunes. It is very important to first write down the original MAC address and keep that information in a safe place so that you can revert this change if necessary. This hack is shown on an iPod touch (4th generation).

It is also very important to not change this to an invalid MAC address. If you change your device's MAC address to something invalid, your internet won't work again until you fix the MAC address (using MobileTerminal or similar). This persists even if you restore -- so you can make this really really hard to fix (you can call it a form of bricking) if you restore and there's no jailbreak available, if the available jailbreaks don't include afc2 and other workarounds aren't working.

Note that changing your UDID can have weird side effects in general, including that you'll have to log in again to everything, including Apple apps.

If you're still willing to risk this, this is the command:

nvram wifiaddr=ma:ca:dd:re:as