Thursday, 7 June 2012

Trying to find out what Mac OSX process is using a particular app

I was trying to remove / trash an app from my Mac ( for the record ), but Finder wasn't allowing me to empty the trash, telling me that something was using the app. even though I knew that it was not running.

To find out what, I put the app back into /Applications ( using the "Put Back" option in Finder / Trash, and then opened up a command prompt.

First I looked to see what was left in the Xcode app folder: -

$ find /Applications/


Then I checked to see what was locking that one remaining file - java-source_lcon.icns: _

$ lsof /Applications/ 

SystemUIS 181 david_hay  txt    REG   14,2    44028 10107074 /Applications/

Then I killed the process: -

$ kill -9 181

( which caused the OSX menu bar to restart )

Then I checked to see whether the lock had been released: -

lsof /Applications/ 

which reported nowt, nothing, nil, nada.

Then I trashed the app again.

Then I emptied the trash :-)

Job done !

No comments: