iOS-Runtime-Headers icon indicating copy to clipboard operation
iOS-Runtime-Headers copied to clipboard

How to access device serial number?

Open FahadAHussain opened this issue 9 years ago • 4 comments

Tried using AppleAccount.framework/AADeviceInfo.h class but it returns null for Serial Number. Any idea?

NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/AppleAccount.framework"];
BOOL success = [b load];

Class FTDeviceSupport = NSClassFromString(@"AADeviceInfo");
id si = [FTDeviceSupport valueForKey:@"serialNumber"];

FahadAHussain avatar Feb 14 '16 07:02 FahadAHussain

AFAIK since 8.3 apple has disable access to the hardware identifiers. All methods to get UDID, IMEI, MAC Addresses... etc will result in getting a null response.

The only way to get access is to add com.apple.private.MobileGestalt.AllowedProtectedKeys to your application entitlements, while you can do that easily it won't be valid as your provisioning profile needs it as well and good luck getting apple to sign it...

joshluongo avatar Feb 14 '16 21:02 joshluongo

How can add com.apple.private.MobileGestalt.AllowedProtectedKeys to your application entitlements?

I'm see on ALTERNATE_PERMISSIONS_FILES in Project/Capabilities but can't add any string to it

Drigin avatar Sep 28 '16 13:09 Drigin

OK. I found that it in Appname.entitlements plist file. And add keys. But now can signed app to my device.

The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).

How I can signed my app?

Drigin avatar Sep 28 '16 14:09 Drigin

So, any solutions for that questions ?

  1. UDID, IMEI, MAC Addresses... etc
  2. The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile

dannyZhou avatar Feb 25 '18 04:02 dannyZhou