how to get iPhone serial number using UIDevice

Discussion in 'iPhone' started by diyora, Feb 3, 2009.

  1. diyora macrumors newbie

    Joined:
    Jul 21, 2008
    #1
    Hello all,
    I want iPhone serial number.For that i use UIDevice class.In this uniqueIdentifier i use for that.I get number but it is different.How i get correct serial number.Is there any conversion required.

    Thank you..
     
  2. iSaygoodbye macrumors 6502a

    iSaygoodbye

    Joined:
    Jan 2, 2009
    Location:
    a boat
    #2
    the serial number is on the box or on the back of the iphone it its that serial number your talking about:p
     
  3. diyora thread starter macrumors newbie

    Joined:
    Jul 21, 2008
    #3
    Thanks,
    But i want serial number programatically.

    Thank you...
     
  4. sparkyms macrumors 65816

    Joined:
    Feb 22, 2007
    Location:
    Southampton UK
    #4
    You can find the UID by plugging it (the iPhone) into iTunes and clicking on the serial number until the UID comes up.
     
  5. Dr. Cabrera macrumors 65816

    Joined:
    Aug 25, 2008
    Location:
    Los Angeles
    #5
    Its on your sim card tray.. not that difficult
     
  6. diyora thread starter macrumors newbie

    Joined:
    Jul 21, 2008
    #6
    Thanks for all your reply...
    As i required serialNo when i code run on iPhone.
    For that is use NSString *deviceId = [[UIDevice currentDevice] uniqueIdentifier];
    But this deviceId is not same as serialNo as given behind the iPhone.

    Thank you...
     
  7. sparkyms macrumors 65816

    Joined:
    Feb 22, 2007
    Location:
    Southampton UK
    #7
    the way I said will work.

    Plug into iTunes and click on the word "Serial Number (or phone number)" until the word "Identifier" comes up.

    thats what youre looking for.


    if you just want the SERIAL, you can go to settings and about on the phone itself.
     
  8. diyora thread starter macrumors newbie

    Joined:
    Jul 21, 2008
    #8
    this things i check early.
    As in UIDevice documentation said uniqueIdentifier provide serialNo.So i try this for get serialNo.But it provide identifier.How i get serialNo programatically.

    Thank you..
     
  9. sparkyms macrumors 65816

    Joined:
    Feb 22, 2007
    Location:
    Southampton UK
    #9
    Then I've no idea what you want or what you mean by "programatically" getting the serial no.
     
  10. kdarling macrumors demi-god

    kdarling

    Joined:
    Jun 9, 2007
    Location:
    First university coding class = 46 years ago
    #10
  11. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #11
    I don't think UIDevice gives access to the actual serial number. All you can get is the UDID, which is the value you already mentioned, which is a hash of something like the serial number and hardware identifiers I think. It is indeed a unique value though, no 2 phones will have the same UDID. For what possible reason would your app need the phone's actual serial number?
     
  12. pirvulescu macrumors newbie

    Joined:
    Jun 25, 2009
    #12
    Here is the answer to your question

    http://www.timeister.com/2009/06/objective-c-get-iphone-number/

    Code:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    [device release];
    NSLog(@”Device GUID: %@”, uniqueIdentifier); 
    --------
    Adrian:)


     
  13. diyora thread starter macrumors newbie

    Joined:
    Jul 21, 2008
    #13
    Hi pirvulescu,

    Code:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    [device release];
    NSLog(@”Device GUID: %@”, uniqueIdentifier);
    I try out this early.

    I again tell this gives the deviceId. It is different from serial number.

    Thank you.
     

Share This Page