Discovering an IPad's own serial number

Discussion in 'iOS Programming' started by multinode, Feb 19, 2011.

  1. multinode, Feb 19, 2011
    Last edited: Feb 19, 2011

    multinode macrumors regular

    Joined:
    Feb 4, 2011
    #1
    The code below residing in my MacBook should work to discover the serial number of my IPad connected to my MacBook's USB port with the 32 pin connector to USB cable. Now I have an urgent need to write some code residing IN MY IPad to discover its own serial number.

    Code:
    - (NSString*)getSerialNumber {
    	CFTypeRef serialNumberAsCFString;
    
    	io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
    
    	if (platformExpert) {
    	      serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0);
    	      }
    
    	IOObjectRelease(platformExpert);
    
    	NSString *serial = [[NSString alloc] initWithFormat:@"%@",serialNumberAsCFString];
    	
    	return serial;
    }
    
    
    Any suggestions?
     
  2. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #2
  3. multinode thread starter macrumors regular

    Joined:
    Feb 4, 2011
    #3
    Thanx for the quick response. More specifically, I need to read some identifying data (UID, serial number, etc.) from BOTH code internal to the IPad AND code residing in my MacBook which sees the IPad as a USB device.
     
  4. lama from east macrumors newbie

    Joined:
    Apr 25, 2011
    #4
    Can one write an app to be able to map locate the Ipad (wifi) via satelite using just the serial number and the unique ID? Is there such a function, method or API? Thanks!
    (i'm aware of mobile me app- but my ipad did not have it set up) My ipad was stollen and want to write an app to locate it (if possible).
     

Share This Page