That's likely because you're still running processes that are using these files. I went ahead and force quit anything related to "sim" or "xcode" and then the command worked. I had Xcode installed to my home folder so I ran this command instead:
sudo rm -rf ~/Library/Developer/*