Get Udid of iOS Device Programmatically

get UDID of IOS device programmatically?

NSString* identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; // IOS 6+
NSLog(@"output is : %@", identifier);

Swift 2.X (HERE X DENOTE ABOVE ALL VERSION FROM 2.0)

let identifier: String = UIDevice.currentDevice().identifierForVendor().UUIDString()
NSLog("output is : %@", identifier)

Swift3

let identifier = UIDevice.current.identifierForVendor?.uuidString

NSLog("output is : %@", identifier! as String)

additional reference

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.

How to get Device UDID in programmatically in iOS7?

It's work 100% to all the version

other best option recommend by apple use ASIdentifierManager Class Reference

ios7-app-backward-compatible-with-ios5-regarding-unique-identifier

this link tell you how to handle and use custom framework

uidevice-uniqueidentifier-property-is-deprecated-what-now

iOS 9

NSUUID *uuid = [[NSUUID alloc]initWithUUIDString:@"20B0DDE7-6087-4607-842A-E97C72E4D522"];
NSLog(@"%@",uuid);
NSLog(@"%@",[uuid UUIDString]);

or

it support only ios 6.0 and above

code to use [[[UIDevice currentDevice] identifierForVendor] UUIDString];

NSUUID *deviceId;
#if TARGET_IPHONE_SIMULATOR
deviceId = [NSUUID initWithUUIDString:@"UUID-STRING-VALUE"];
#else
deviceId = [UIDevice currentDevice].identifierForVendor;
#endif

ios 5 to use like

 if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
// This is will run if it is iOS6
return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// This is will run before iOS6 and you can use openUDID or other
// method to generate an identifier
}

How to get UDID Programmatically in Swift on iOS

identifierForVendor is not the device UUID. You cannot programmatically access the device UUID. The only ID you are supposed to use to identify a device is identifierForVendor, which intentionally can change if the user uninstalls all of your apps. There is, intentionally, no fixed-to-the-device ID that you are permitted to access.

Get device UDID (40 digit id) programmatically

You can't as of iOS 6.

Link #1

Money quote:

As reported by 9to5Mac (and confirmed by Macworld), Apple alerted
developers of a cut-off date for new apps or app updates that access
an iOS device’s UDID (Universal Device ID), an area of security and
privacy concern.

Link #2

Extended money quote:

With iOS 6 Apple has also completely eliminated its controversial
Universal Device IDs (UDID) and replaced it with a more
privacy-friendly way for application vendors and advertisers to
identify specific devices, Hall said,

Apple’s UDIDs are basically a set of alphanumeric characters that are
used to uniquely identify an iPhone or iPad. The numbers are designed
to let application developers track how many users have downloaded
their application and to gather other information for data analytics.

From the same article, the way to go now is:

With the new iOS 6 the company has gone one step further by
eliminating UDIDs completely and replace with a set of three new devie
identifiers. One is a vendor specific identifier that can be used by
application vendors to recognize specific devices, another is designed
for use by online advertisers and the third is an application-specific
ID. Unlike UDID’s, the new identifiers are not persistent and can be
cleared, though the device has to be completely reset to get rid of
the advertiser identities, Hall said.

In conclusion, the correct way is to either (a) use UUID or (b) ask your user for the device's UDID.

Get UDID of iOS Simulators programmatically using c#

You can launch from C# a system tool simctl , to see manual page, launch in Terminal:

xcrun simctl help

You can get list of devices in JSON format and find device with state Booted:

xcrun simctl list --json devices available

<...>
{
"dataPath" : "\/Users\/admin\/Library\/Developer\/CoreSimulator\/Devices\/2BE68BC5-02C0-4B1C-92EC-E80CCE713144\/data",
"logPath" : "\/Users\/admin\/Library\/Logs\/CoreSimulator\/2BE68BC5-02C0-4B1C-92EC-E80CCE713144",
"udid" : "2BE68BC5-02C0-4B1C-92EC-E80CCE713144",
"isAvailable" : true,
"deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-12-Pro-Max",
"state" : "Booted",
"name" : "iPhone 12 Pro Max"
},
<....>

Or in less convenient for C# way:

xcrun simctl list | grep Booted

You can find path to xcrun with:

which xcrun

programmatically get UDID for a demo app?

If my answer helps you I would be happy!

Answer 1 :

UDID Finding Process

  1. Open the following link in your iOS device : http://get.udid.io/
  2. Click on Tap to find your UDID
  3. It will lead you to Install Profile where you can find INSTALL in top right corner. Tap on it
  4. Now you will be redirected to a webpage which will show you the UDID. Share that ID to developer team.

Answer 2 :

  1. Archive your project to create .ipa file.
  2. Upload your .ipa file to this link http://diawi.com/ to create app link.
  3. Provide the link to your testing team.

Note: This link is not permanent and will expire within a month.



Related Topics



Leave a reply



Submit