4

I was trying to use the iOS7 simulator in El Capitan in Xcode 6.4, deleted it, reinstalled it etc. Part of that was dragging iOS 7.1.simruntime from /Library/Developer/CoreSimulator/Profiles/Runtimes to Trash. Now I want to empty the Trash and it does not work.

  1. Open Trash, click "Empty": "The operation can’t be completed because the item “iOS 7.1.simruntime” is in use"

  2. Terminal:

mba7:.Trash fsc$ rm -rf iOS\ 7.1.simruntime
rm: iOS 7.1.simruntime/System/Library/Receipts/com.apple.pkg.iPhoneSimulatorSDK7_1.bom: Operation not permitted
rm: iOS 7.1.simruntime/System/Library/Receipts/com.apple.pkg.iPhoneSimulatorSDK7_1.plist: Operation not permitted
rm: iOS 7.1.simruntime/System/Library/Receipts: Operation not permitted
rm: iOS 7.1.simruntime/System/Library: Directory not empty
rm: iOS 7.1.simruntime/System: Directory not empty
rm: iOS 7.1.simruntime: Directory not empty
mba7:.Trash fsc$ 
  1. Terminal: "sudo"
mba7:.Trash fsc$ sudo rm -rf iOS\ 7.1.simruntime
... same error
  1. "lsof" (output manually wrapped)
mba7:.Trash fsc$ sudo lsof | grep "simruntime"
com.apple 743            root  txt       REG                1,4     
58608            21307311 /Library/Developer/CoreSimulator/Profiles/Runtimes/
iOS 8.4.simruntime/Contents/Resources/RuntimeRoot
/usr/lib/system/host/liblaunch_sim.dylib

I already restarted several times, tried to change permissions etc.

What other steps can I take to get rid of the files?

  • Xcode or simulator are running when your a trying to delete ? Did you tried to " $ sudo rm -rf ~/.Trash/* " ? – StrawHara Nov 18 '15 at 10:02
  • @MrMojoRisin No Xcode and no simulator is running. Yes, I tried sudo rm - same error. – Rainer Schwarze Nov 18 '15 at 10:54
4

You need to disable System Integrity Protection (SIP).

  • Reboot the Mac in Recovery mode : Hold down Command + R after you hear the startup chime
  • Launch the terminal (Utilities > Terminal)
  • csrutil disable
  • Reboot
  • Empty your trash
  • Reboot again in Recovery mode
  • Launch the terminal
  • csrutil enable
  • Reboot
  • Please make sure you file a radar, capturing as much state as you can, before doing this. This is likely a bug in SIP as you should be able to remove those receipts. – Jeremy Huddleston Sequoia Nov 18 '15 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .