LoginSignup
3
3

More than 5 years have passed since last update.

複数のXcodeのデバイスディスクイメージを共有する

Last updated at Posted at 2016-11-17

複数の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へビルド出来るようになったりする

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3