How can I retrieve the UDID on iOS?

前端 未结 10 1305
礼貌的吻别
礼貌的吻别 2020-12-14 06:05

I was wondering if it was possible to find out the UDID of the user\'s iPhone. Can someone shed some light?

相关标签:
10条回答
  • 2020-12-14 06:52

    In IOS5 and above, use this one to find UDID

    NSString *uuidString = nil;
    CFUUIDRef uuid = CFUUIDCreate(NULL);
    if (uuid) {
        uuidString = (__bridge NSString *)CFUUIDCreateString(NULL, uuid);
        CFRelease(uuid);
    }
    NSLog(@"UDID: [%@]", uuidString);
    
    0 讨论(0)
  • 2020-12-14 06:52

    Remember UDID is deprecated in IOS 5. In iOS 7, Apple now always returns a fixed value when querying the MAC to specifically thwart the MAC as base for an ID scheme. So you now really should use -[UIDevice identifierForVendor] or create a per-install UUID. Hope it will help for someone.

    0 讨论(0)
  • 2020-12-14 06:53

    It's very simple. Go to Xcode Window and select Devices or you can find it in Organizer.enter image description here

    http://www.raywenderlich.com/2915/ios-code-signing-under-the-hood/organizerudid

    0 讨论(0)
  • 2020-12-14 06:56

    In IOS5 and above, use this one to find UDID

    NSString *uuidString = nil;

    CFUUIDRef uuid = CFUUIDCreate(NULL); ...

    I think you are showing how to generate a unique identification number, not to get the unique id of a device.

    0 讨论(0)
提交回复
热议问题