获取iOS设备的相关信息

NSString *ssid = @"Not Found";

NSString *macIp = @"Not Found";

//    BA5DC546-E961-44B0-85FA-D5CD4C39BF57

//   4B9E7471-EF79-4EF5-AEA8-C700CC6D7039

CFUUIDRef puuid = CFUUIDCreate( nil );

CFStringRef uuidString = CFUUIDCreateString( nil, puuid );

NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString));

NSLog(@"%@",result);

//    And to use it

CLBeaconRegion *_myBeaconRegion;

NSDictionary *myBeaconData = [_myBeaconRegion peripheralDataWithMeasuredPower:nil];

NSLog(@"%@",myBeaconData);

NSString *identifierForVendor = [[UIDevice currentDevice].identifierForVendor UUIDString];

//    NSString *identifierForAdvertising = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

//设备相关信息的获取

NSLog(@"%@",identifierForVendor);

NSString *strName = [[UIDevice currentDevice] name];

NSLog(@"设备名称:%@", strName);//e.g. "My iPhone"

NSString *strId = [[UIDevice currentDevice] identifierForVendor];

NSLog(@"设备唯一标识:%@", strId);//UUID,5.0后不可用

NSString *strSysName = [[UIDevice currentDevice] systemName];

NSLog(@"系统名称:%@", strSysName);// e.g. @"iOS"

NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];

NSLog(@"系统版本号:%@", strSysVersion);// e.g. @"4.0"

NSString *strModel = [[UIDevice currentDevice] model];

NSLog(@"设备模式:%@", strModel);// e.g. @"iPhone", @"iPod touch"

NSString *strLocModel = [[UIDevice currentDevice] localizedModel];

NSLog(@"本地设备模式:%@", strLocModel);// localized version of model

CFArrayRef myArray = CNCopySupportedInterfaces();

NSLog(@"%@",myArray);

//    80:89:17:31:4b:52

//    94:b4:f:6f:65:80

if (myArray != nil) {

CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));

if (myDict != nil) {

NSDictionary *dict = (NSDictionary*)CFBridgingRelease(myDict);

NSLog(@"%@",dict);

ssid = [dict valueForKey:@"SSID"];

macIp = [dict valueForKey:@"BSSID"];

NSDictionary *ssidData = [dict valueForKey:@"SSIDDATA"];

NSLog(@"......%d",ssidData.count);

}

}

NSLog(@"ssid>>>%@,macIp---->>%@",ssid,macIp);

推荐阅读更多精彩内容