您的位置:首页 > 产品设计 > UI/UE

NSProcessInfo获取进程信息,UIDevice获取设信息

2016-07-21 12:06 776 查看
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
@autoreleasepool {
//获取当前进程对应的ProcessInfo对象
NSProcessInfo *proInfo = [NSProcessInfo processInfo];
//获取运行改程序所指定的参数
NSArray *arr = [proInfo arguments];
NSLog(@"运行程序的参数为:%@",arr);
NSLog(@"进程标识符为:%d",[proInfo processIdentifier]);
NSLog(@"进程的进程名为:%@",[proInfo processName]);
NSLog(@"进程所在系统的主机名:%@",[proInfo hostName]);
NSLog(@"进程所在系统的操作系统为:%lu",(unsigned long)[proInfo operatingSystem]);
NSLog(@"进程所在系统的操作系统名为:%@",[proInfo operatingSystemName]);
NSLog(@"进程所在系统的操作系统版本字符串为:%@",[proInfo operatingSystemVersionString]);
NSLog(@"进程所在系统的物理内存为:%lld",[proInfo physicalMemory]);
NSLog(@"进程所在系统的处理器数量为:%ld",[proInfo processorCount]);
NSLog(@"进程所在系统的激活的处理器数量为:%ld",[proInfo activeProcessorCount]);
NSLog(@"进程所在系统的运行时间为:%f",[proInfo systemUptime]);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: