Following Xcode reveals you the device id

 
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
/*[device release];*/
NSLog(@"Device GUID: %@", uniqueIdentifier);
Bookmark and Share
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • 豆瓣九点

Tags: , , ,

2 Responses to “Objective C Get iPhone Device GUID”

  1. Kristian Glass 02. Dec, 2009 at 1:58 pm #

    Please see http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html and http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html – you should *NOT* release device, as you have not (alloc/new/copy/retain)-ed it.

  2. Dylan Barrie 02. Dec, 2009 at 2:41 pm #

    This code is fundamentally flawed. The UIDevice retrieved via +[UIDevice currentDevice] is not initialized, retained, or copied by the calling function, nor does ‘currentDevice’ have the words ‘init’ or ‘copy’ in it. The returned device MUST NOT be released, since it was not retained, initialized, or copied.

    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];

    is correct.