IOS-获取Model(设备型号)、Version(设备版本号)、app(程序版本号)等

我怕爱的太早我们不能终老 提交于 2019-12-11 11:08:14

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

    // app名称

    NSString *app_Name1 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

    

    NSString *app_Name = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];

    

    NSString *app_Name2 = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey]];

    

    NSLog(@"==============1%@-----%@---%@",app_Name1,app_Name,app_Name2);

    

    // app版本

    

    NSString *app_Version1 = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey]];

    

    NSString *app_Version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

    NSLog(@"==============1%@---%@",app_Version1,app_Version);

    

    // app build版本

    NSString *app_build1 = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];

    

    NSString *app_build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

    NSLog(@"==============1%@---%@",app_build1,app_build);


    

    //ios获取系统信息

    //NSLog(@"identifier: %@", [[UIDevice currentDevice] identifierForVendor]);

    //NSLog(@"name: %@", [[UIDevice currentDevice] name]);

    //NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);

    //NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);

    //NSLog(@"model: %@", [[UIDevice currentDevice] model]);

    //NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);

        IOS获取IP 参考:http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!