Skip to content

Not enough memory or storage space. Release some space in ~ Library.

Snoy-Kuo edited this page Mar 24, 2022 · 2 revisions

Description

When a Mac is new, it run super smooth. When it used for program dev, two or three years later. It becomes hard to use. Filled with cache and unused files. I cleaned up these dirs: ~/Documents, ~/Downloads, ~/Desktop. But still hard to get more than 10 GB. Ok, let's check if we can release some space in ~/Library.

Dev env

  • macOS 11.6 (Big Sur) x64
  • Android Studio Bumblebee Patch 1
  • Android SDK version 31
  • Android Gradle Plugin: 7.0
  • Gradle: 7.1.1
  • Gradle JDK: 11

Tried approaches

  • Remove unused java version.

    • echo $JAVA_HOME see what version currently in use.
    • cd ~/Library/Java/JavaVirtualMachines, then ls -halt or open ., and delete unused version.
    • cd ~/Library/PreferencePanes/Java, then ls -halt or open ., and delete unused version. (This maybe not exist.)
    • cd ~/Library/Internet\ Plug-Ins/Java, then ls -halt or open ., and delete unused version. (This maybe not exist.)
      => It works!'
  • Remvoe unused Apple device emulators and data.

    • xcrun simctl list devices to list all emulators.
    • xcrun simctl delete unavailable to delete all unavailable emulators.
    • xcrun simctl erase all to wipe all emulators' data. (use carefully)
    • xcrun simctl help for further help.
    • sudo rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/ to remove Apple cached files.
      => It works!'

Solutions

  • Remove unused java version.

    • cd ~/Library/Java/JavaVirtualMachines, then ls -halt or open ., and delete unused version.
  • Remvoe unused Apple device emulators and data.

    • xcrun simctl list devices to list all emulators.
    • xcrun simctl delete unavailable to delete all unavailable emulators.
    • xcrun simctl erase all to wipe all emulators' data. (use carefully)
    • sudo rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/ to remove Apple cached files.