Xcode Deleting Remaining Files

Monterey Operating System

Hi, I uninstalled Xcode because I didn't need it anymore. Unfortunately, it left a ton of files and immediately after the uninstall I started getting a system update little red flag on my system update notices. I turned off automatic updates as I really don't want to download Xcode again. I went in and deleted a ton of the files that were left manually. I really hate not having automatic updates on. But, these are left:


/System/Library/Automator/Build Xcode Project.action

/usr/share/man/man1/xcode-select.1

/usr/share/zsh/5.8.1/functions/_xcode-select

/System/Library/CoreServices/Xcode Previews.app

/System/Library/LifecyclePolicy/DomainAttributes/com.apple.xcodepreviews.plist

/System/Library/LaunchAgents/com.apple.dt.xcodepreviewsapp.plist

/usr/bin/xcode-select


I have tried deleting them from Terminal in Restore mode, I have tried turning off CSRUTIL and deleting them in restore mode, I am getting close to wiping the disk and starting from scratch to get rid of these things. Even with rm -rf and csrutil disabled, they return system read only file when I try to delete them. Can anyone here give me a step by step on how to delete these last 7 files that Apple just refuses to allow me to delete? I would appreciate any help as I am sure that my pesky system update is based on one of these.

Posted on Jan 26, 2024 10:42 PM

Reply
12 replies

Jan 27, 2024 10:02 AM in response to DaveinCR

Remove Xcode and remove the simulators. That’s the vast majority of the storage.


The rest, particularly anything protected by SIP, is likely not removable, and probably won’t amount to all that much storage.


The xcode-select stuff and Xcode Previews is part of macOS, which makes me wonder if some of the other stuff listed is also part of macOS. I’d guess the Automator stuff is too, but don’t have a not-had-Xcode-installed Mac to check that.

Jan 27, 2024 6:53 PM in response to DaveinCR

You are focused on deleting some parts of macOS, and I’m suggesting you follow through on it. I’d expect it won’t help, but it’s likely also the only way you will no longer be focused on that approach. That’s not sarcasm.


The usual cause of these “update” messages is a stale copy of an app-store-installed Xcode.app located somewhere on the Mac including on other mounted disks, or maybe there’s a corruption in the Spotlight index. Simulators are the other big hunk, but AFAIK those don’t get considered with App Store updates.

Jan 27, 2024 11:54 AM in response to DaveinCR

Thanks for the reply, it's not space I'm concerned about. One of these remaining files is triggering the update app in system notifications. I have disabled auto updates because of this as I do t want to reinstall code. Therefore, these or the one triggering the update, needs to be deleted. Therefore, my question stands as to how.


Thanks!

Jan 27, 2024 4:55 PM in response to DaveinCR

I will look, though I can't imagine a situation where said file wouldn't show up using MDFIND, so I can only venture to guess no. Which would lead me back to trying to delete these final 6 files, which is really the point as they are no longer needed. I might add, that doing a quick search online, I'm definitely not alone in this situation.

Jan 27, 2024 5:07 PM in response to DaveinCR

DaveinCR wrote:

I will look, though I can't imagine a situation where said file wouldn't show up using MDFIND, so I can only venture to guess no. Which would lead me back to trying to delete these final 6 files, which is really the point as they are no longer needed. I might add, that doing a quick search online, I'm definitely not alone in this situation.


So shut off system integrity, and blow away what are unrelated files, and various of which are part of macOS.


(If that file deletion is even possible anymore.)

Jan 27, 2024 6:42 PM in response to MrHoffman

Thank you, as stated originally, csrutil disable was attempted but these files are still not able to be deleted. By the way, I don't appreciate the sarcastic response, it's not needed. If you are unable assist further I understand, but the question remains for someone else. If not, I'll wipe the OS and reinstall I guess, but it seems a bit ridiculous to have to do this for six files. Thanks again

Jan 27, 2024 7:40 PM in response to MrHoffman

Clearly, these xcode files I named are not part of the original OS. That being said, let's say hypothetically that as I was uninstalling, the system was checking for updates at the unfortunate exact moment. This would have triggered an update flag somewhere. Let's say, one wanted to clear all updates and have the system rescan for updates. How would one go about this task...I personally think that this is not likely and one of the remaining files...being an executable....are what is triggering the update however I'm willing to play along.

Jan 28, 2024 7:24 AM in response to MrHoffman

Ok, just fyi, no simulators, no other stale copies, nothing at all except those remaining files. Also, interesting to note, it won't let me chmod 777 those files either in recovery mode even with csrutil disabled. It's really annoying, unless anyone has any suggestions I'm down to a reinstall of the OS, or just leaving auto updates off.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Xcode Deleting Remaining Files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.