Call of functions related to iOS and ios
Device information
Note: To obtain the mobile phone model, you need to import # import "sys/utsname. h" to obtain the operator. # import
# Import
// Unique device identifier NSString * identifierStr = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; NSLog (@ "unique device identifier: % @", identifierStr); // cell phone alias: user-Defined name NSString * userPhoneName = [[UIDevice currentDevice] name]; NSLog (@ "Mobile Phone alias: % @", userPhoneName ); // device name NSString * deviceName = [[UIDevice currentDevice] systemName]; NSLog (@ "device name: % @", deviceName ); // mobile phone system version NSString * phoneVersion = [[UIDevice currentDevice] systemVersion]; NSLog (@ "Mobile Phone System Version: % @", phoneVersion); // mobile phone model struct utsname systemInfo; uname (& systemInfo); NSString * deviceString = [NSString stringWithCString: systemInfo. machine encoding: NSUTF8StringEncoding]; // iPhone // NSString * phoneModel = [self]; NSLog (@ "Mobile Phone model: % @", deviceString ); // local model (International region name) NSString * localPhoneModel = [[UIDevice currentDevice] localizedModel]; NSLog (@ "International region name: % @", localPhoneModel ); NSDictionary * infoDictionary = [[NSBundle mainBundle] infoDictionary]; // The current application software version, for example, 1.0.1 NSString * appCurVersion = [infoDictionary objectForKey: @ "cfbundlepolicversionstring"]; NSLog (@ "current application version: % @", appCurVersion); // The int type NSString * appCurVersionNum = [infoDictionary objectForKey: @ "CFBundleVersion"]; NSLog (@ "current application version number: % @", appCurVersionNum); CGRect rect = [[UIScreen mainScreen] bounds]; CGSize size = rect. size; CGFloat width = size. width; CGFloat height = size. height; NSLog (@ "physical size: %. 0f × %. 0f ", width, height); CGFloat scale_screen = [UIScreen mainScreen]. scale; NSLog (@ "Resolution: %. 0f × %. 0f ", width * scale_screen, height * scale_screen); CTTelephonyNetworkInfo * info = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier * carrier = info. subscriberCellularProvider; NSLog (@ "carrier: % @", carrier. carrierName );---------