4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ディスク容量が足りなくなった時

Last updated at Posted at 2021-02-17

Dockerを使って開発したりアプリ開発したりしているとギガがすぐに無くなるので自分用のメモ

調査&削除方法

GUIから調査&削除

メニューバーの一番左のAppleのログを押して、
「このMacについて」>「ストレージ」>「管理...」と遷移して、
容量の大きいデータを調査し、適宜削除を実行する

Terminalから調査&削除

ディレクトリの各階層に移動して1GB以上容量を食っているディレクトリを列挙

du -sh ./* | grep -E '[0-9]+\.?[0-9]+G'

だいたいいつも ~/Library 以下に容量を食っているディレクトリがある(気がする)

よくやるやつ

不要なDockerのデータを削除

docker system prune

実行すると、以下のように削除される対象が表示されるので、問題がなければ「y」を押して削除実行

WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache
  
Are you sure you want to continue? [y/N]

不要なiOSのSDKを削除

cd ~/Library/Developer/Xcode/iOS DeviceSupport
# ex. 13.1.1を削除
# rm -rf ./13.3.1\ \(17D50\)

不要なiOSのビルドイメージを削除

cd ~/Library/Developer/Xcode/DerivedData
# ex. すべて削除
# rm -rf ./*

不要なiOSのシミュレータを削除

# 事前に確認
xcrun simctl list
# unavailableなものを削除
xcrun simctl delete unavailable

不要なiOSシミュレーターのキッシュを削除

cd ~/Library/Developer/CoreSimulator/Caches
# ex. すべて削除
# rm -rf ./*

不要なAndroidのsdk imageを削除

cd ~/Library/Android/sdk
# ex. android-26を削除
# rm -rf ./system-images/android-26

まとめ

開発機は256GB無理!!
512GB以上にしよう

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?