iOS 之獲取APP與手機 資訊

A訫飛Flyme發表於2017-12-19
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    CFShow(CFBridgingRetain(infoDictionary));//
    // app名稱
    NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
    NSLog(@"應用名字:%@",app_Name);
    // Version版本
    NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    NSLog(@"Version版本:%@",app_Version);
    // build版本
    NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];
    NSLog(@"Build版本:%@",app_build);
    //手機序列號
    NSUUID* identifierNumber = [[UIDevice currentDevice] identifierForVendor];
    NSLog(@"手機序列號: %@",identifierNumber);
    //手機別名:使用者定義的名稱
    NSString* userPhoneName = [[UIDevice currentDevice] name];
    NSLog(@"手機別名: %@", userPhoneName);
    //系統名稱
    NSString* deviceName = [[UIDevice currentDevice] systemName];
    NSLog(@"系統名稱: %@",deviceName );
    //手機系統版本
    NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
    NSLog(@"手機系統版本: %@", phoneVersion);
    //手機型號
    NSString* phoneModel = [[UIDevice currentDevice] model];
    NSLog(@"手機型號: %@",phoneModel );
    //地方型號(國際化區域名稱)
    NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];
    NSLog(@"國際化區域名稱: %@",localPhoneModel );
複製程式碼

相關文章