Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

multinode

macrumors regular
Original poster
Feb 4, 2011
150
0
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?
 
Last edited:
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).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.