Free space in your Mac for Mobile Development

ยท 321 words ยท 2 minute read

If you are developing mobile apps for Android and/or iPhone and iPad, make sure to delete unused old software you installed in your journey to develop apps through months of updates and installations of libraries and tools.

If you do not want to clean your xcode on Mac manually, there are DevCleaner for Xcode which helps your delete obsolete/unwanted software tools/libs/cache/log.

Android Studio ๐Ÿ”—

clean up Gradle ๐Ÿ”—

Your Gradle Home directory contains wrapper, caches and daemons files. The more projects with diffferent gradle versions the more subdirectories within those three folders. You can delete all three directories. This saved me a cool ~10GB of space.

Just use these two commands.

cd ~/.gradle
rm -rf caches daemon wrapper

clean up Android SDK ๐Ÿ”—

Android System images are only used by emulators. If you use a real Android device during development for debugging, you no longer need them, so you can remove them all. This could easily save you 5GB doing this.

clean unwanted android sdk

Xcode ๐Ÿ”—

1. Remove Old Simulators ๐Ÿ”—

As with Android the major culprit will be old simulators that take alot of space. The simulator files are by default located in ~/Library/Developer/Xcode/iOS/Device Support folder. You can delete old simulators using the following command.

xcrun simctl delete unavailable

2. Remove Cocoapod Caches ๐Ÿ”—

If you use Cocoapods in your projects you can clear them using this command. Don’t worry you can rebuild them later again.

rm -rf "${HOME}/Library/Caches/CocoaPods"

3. Clean up Archives,Logs and DerivedData folders ๐Ÿ”—

Folders like DerivedData can take up a significant amount of space too. DerivedData is generated during each build process. This contains intermediate build results,indexes that speed up time on each build. You can use the commands below to clear all that data.

rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/iOS\ Device\ Logs/

There are too many things you call remove from your macOS to free up some more space, see all the steps here .