Edited at

Removing only all App Store Applications

More than 5 years have passed since last update.

Of course you should wipe the HDD if you sell your Mac, but this script (Ruby 1.8.7 or 2.0.0) could be useful if you are just renewing your Mac in your Office and returning the old one.

[App Storeアプリだけを全て削除する]


Ruby 1.8.7と2.0.0で(rm_r以外)動作確認しました。10.9でなくとも大丈夫です。

[追記] Ruby 2.0.0とOSX 10.9の組み合わせで正常に削除成功しました。


#!/usr/bin/env ruby

require 'fileutils'
puts app
FileUtils.rm_r(app,{:force=>true,:secure=>true}) # need sudo