[categories] [index] [all (552)] [latest]
NSProcessInfo *pi = [NSProcessInfo processInfo];
NSLog(@"environment SHELL: %@", [[pi environment] objectForKey:@"SHELL"]);
NSLog(@"globallyUniqueString: %@", [pi globallyUniqueString]);
NSLog(@"hostName: %@", [pi hostName]);
NSLog(@"processIdentifier: %d", [pi processIdentifier]);
NSLog(@"processName: %@", [pi processName]);
[pi setProcessName:@"MyProcessNewName"];
NSLog(@"processName: %@", [pi processName]);
NSLog(@"operatingSystem: %d", [pi operatingSystem]);
NSLog(@"operatingSystemName: %@", [pi operatingSystemName]);
NSLog(@"operatingSystemVersionString: %@", [pi operatingSystemVersionString]);
NSLog(@"processorCount: %d", [pi processorCount]);
NSLog(@"activeProcessorCount: %d", [pi activeProcessorCount]);
NSLog(@"physicalMemory: %qu", [pi physicalMemory]);
NSLog(@"args: %@", [pi arguments]);
Output:
environment SHELL: /bin/bash
globallyUniqueString: F68E72F1-257C-4E93-B23D-BA3A0DD15603-47346-0001600092C640D8
hostName: nst.local
processIdentifier: 47346
processName: Untitled
processName: MyProcessNewName
operatingSystem: 5
operatingSystemName: NSMACHOperatingSystem
operatingSystemVersionString: Version 10.5.4 (Build 9E17)
processorCount: 2
activeProcessorCount: 2
physicalMemory: 2147483648
args: (
"/Library/XCodeBuilds/Debug/Untitled"
)