ios get programName and processInfo

        NSString *programName = [NSString stringWithUTF8String:getprogname()];    //get project name
	int pid = [[NSProcessInfo processInfo] processIdentifier];     // get process info
	NSString *message = [NSString stringWithFormat:@"%@[%d]", programName,pid];
	NSLog(@"-----%@",message);
	

output:
        2017-08-25 16:02:05.775792+0800 test[6676:293674] -----xulinmeiTest[6676]
posted @ 2017-08-25 16:05  笑笑就好90  阅读(91)  评论(0编辑  收藏  举报