views:

28

answers:

2

How can i get a process by know process name on mac os?

A: 

Your question is rather vague. Can you define what you mean by "get a process"?

One method (depending on your definition): launch the Activity Monitor app in Applications/Utilities, and look up the process name in the list.

Shaggy Frog
I finished it!My sample:bool IsInBSDProcessList(char *name)// Return YES if given name process in process list . Otherwise return NO{ assert( name != NULL); kinfo_proc *result; size_t count = 0; result = (kinfo_proc *)malloc(sizeof(kinfo_proc)); if(GetBSDProcessList( i < count; i++) { kinfo_proc *proc = NULL; proc = if(strcmp(name, proc->kp_proc.p_comm) == 0) { free(result); return true; } } } free(result); return false;}
Haley
A: 

Perhaps

ps -eaf

from a console

David Sykes
no,not from a consolethx same
Haley