複数のXcodeを入れている場合に容量がかさみます。
GrandPerspectiveなどでみると分かるのですが、Xcodeの容量の多くをDevice Support
というものが占めています。
このDeviceSupportは、iOSのバージョンごとに存在する上にひとつひとつの容量が大きいため複数のXcodeで共有したいところです。
Xcodeのバージョンが違えど基本的にはDeviceSupportは参照さえできれば使えるので、最新のXcodeからDeviceSupportを抜いて全てのXcodeがそこを参照するようにすれば良いのです。
sudo mv /Applications/Xcode82b2.app/Contents/Developer/Platforms /Applications/Platforms
/Applicationに配置してみました。(/Developerの方がいいか…
Platformsの中にDeviceSupportがいるのでまるごとでOKです。
次にXcodeに元からあるPlatformsを消していきます。
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms
sudo rm -rf /Applications/Xcode81.app/Contents/Developer/Platforms
sudo rm -rf /Applications/Xcode82b2.app/Contents/Developer/Platforms
あとは以下の用に全部のXcodeに撒けばOK
sudo ln -s /Applications/Platforms /Applications/Xcode.app/Contents/Developer/Platforms
sudo ln -s /Applications/Platforms /Applications/Xcode81.app/Contents/Developer/Platforms
sudo ln -s /Applications/Platforms /Applications/Xcode82b2.app/Contents/Developer/Platforms
副作用
古いバージョンのXcodeも新しいDeviceSupportが参照出来るようになるので、Xcode7.3でiOS10.2へビルド出来るようになったりする