Cleaning Up Simulators with AI
How I saved hundreds of gigabytes of space by asking AI to delete old iOS simulators.
How I saved hundreds of gigabytes of space by asking AI to delete old iOS simulators.
As an iOS developer, every time there is even a minor update to iOS, like iOS 18.3 from 18.2, a new simulator is downloaded for each device that I am simulating on my computer. If I have simulators for the last 3 sizes of iPhone and the 3 from the year before that as well as 8 iPads, I commonly end up with 14 simulators that get updated each time there is a minor iOS or iPadOS update.
If you keep doing this for a year or two, you can end up with a hundred simulators that you have never used or opened on your computer. It is tedious and annoying to go through and delete all of them just to clear up space. But this is where AI on your computer can be incredible at saving time. You can have it tell you exactly what to do to delete these simulators and save hundreds of gigabytes of storage on your hard drive.
I use a specific prompt to handle this cleanup. It usually goes something like this
Please list all the iOS simulators I have installed. Then, create a script to delete all of them except for the latest version for each device class, and one older version from each major iOS release.
This simple request often recovers significant storage space for me.
You can also use this approach for more general file cleanup. I want to give a prompt that can be used by other people to run on their own computer to be able to figure out what large files they can delete to free up storage on their computer without reducing functionality.
Find all files larger than 2 GB that have not been opened in the last 6 months. List them for me so I can decide which ones to delete to free up space.
Usually, I let the AI know that I want to keep the latest version of the simulator for each device class as well as one older one from each major iOS version. But the prompt above can also be helpful for any individual files that have not been opened in the last 6 months and are larger than 2 GB.
If you are reading this in the future, you can now do this for free even if you do not have a paid account. You can use the Gemini CLI to run these maintenance tasks directly from your terminal. It connects to your local file system and can execute these cleanup scripts safely.