Skip to content

Instantly share code, notes, and snippets.

@jimklo
Forked from matti/xcode-nuke-uninstall.rb
Created April 21, 2017 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimklo/18a3704ab9296ff4f59a4863046bdb21 to your computer and use it in GitHub Desktop.
Save jimklo/18a3704ab9296ff4f59a4863046bdb21 to your computer and use it in GitHub Desktop.
completely remove all xcode files
#!/usr/bin/env ruby
cancer_in_home = [
"Library/Developer",
"Library/Preferences/com.apple.dt.*",
"Library/Caches/com.apple.dt.*",
'Library/Application\ Support/Xcode'
]
cancer_in_root = [
"/Library/Preferences/com.apple.dt.Xcode.plist"
]
def remove(path, sudo=false)
sudocmd = if sudo
"sudo "
else
""
end
`#{sudocmd}rm -rf #{path}`
puts "#{path} nuked"
end
for home_path in cancer_in_home do
remove("$HOME/#{home_path}")
end
for path in cancer_in_root do
remove(path, true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment