How to kill a process in MacOS?

后端 未结 9 1730
日久生厌
日久生厌 2021-01-30 04:05

I tried kill -9 698 but the process did not die.

$ ps -ef | grep chromium
  502   698   811   0   0:01.24 ??         0:07.28 /Users/lucius/chromium/         


        
9条回答
  •  伪装坚强ぢ
    2021-01-30 04:20

    Given the path to your program, I assume you're currently running this under Xcode, and are probably at a debug breakpoint. Processes cannot be killed in this state because of the underlying implementation of breakpoints.

    The first step would be to go to your Xcode process and stop debugging. If for some strange reason you have lost access to Xcode (perhaps Xcode has lost access to its gdb sub-process), then the solution is to kill the gdb process. More generally, the solution here is to kill the parent process. In your case this is PID 811 (the third column).

    There is no need to use -9 in this case.

提交回复
热议问题