Docs
Automatic clean up of old builds
A busy CI pipeline uploads many builds. Set a rule per project and AppForShare moves old builds to the restore list on its own, so your storage stays free for the builds testers still use. Pro and Team.
Set the rule
Open the project, then its Testing page, and find "Automatic clean up of old builds". Choose one or both:
- Keep the newest N builds per platform, from 5 to 200.
- Remove builds older than 30, 60, 90 or 180 days.
With both, a build goes only when it breaks both rules: it is outside the newest N of its platform and older than the age you picked.
Never removed
- The newest build of each platform in the project.
- The build a channel opens right now.
- Builds in a client delivery, so every signed off version stays.
- Builds sent to TestFlight or Google Play in the last 90 days.
- Builds marked keep on the build page.
Restore list and the weekly email
Removed builds go to the normal 7 day restore list. Once a week the owner gets one email naming what went and the storage freed when the restore window ends. Every run is also a line in the activity feed.
CLI and MCP
appforshare cleanup --project <id> [--keep n] [--older-than d] [--dry-run] [--yes]. Without --keep and --older-than it uses the project's saved rule. --dry-run lists only; a real run needs --yes and an Owner or Admin. The MCP tool cleanup_preview shows your AI coding assistant what a clean up would remove, the storage it would free and the old builds it keeps on purpose. It is read only.
# what would go, and the storage it would free; nothing is removed
npx appforshare cleanup --project 42 --keep 20 --older-than 90 --dry-run
# run it now with the project's saved rule (Owner or Admin)
npx appforshare cleanup --project 42 --yes
# bring one back within 7 days
npx appforshare restore
npx appforshare restore AbC123Questions
- Which plans include automatic clean up?
- Pro and Team. On Free, builds already expire after 7 days, so there is nothing to clean up.
- When does it run?
- Once a day. After you save a rule, the first run is in about a day, and nothing is removed before that.
- Is a removed build gone for good?
- Not at once. A removed build goes to the 7 day restore list, the same as a build you delete by hand. Restore it from the dashboard or with appforshare restore. After 7 days its files are deleted and the storage is freed.
- Can I protect one build?
- Yes. Open the build and turn on "Keep this build". Automatic clean up never removes a build marked keep. You can still delete it by hand.
- Who sets the rule?
- The Owner or an Admin, per project, on the project's Testing page. A real run from the CLI also needs an Owner or Admin.
- Can my AI assistant remove builds?
- No. The MCP tool cleanup_preview is read only: it shows what a clean up would remove and keep. There is no MCP delete.
Overview: automatic clean up. Related: where build files are stored, storage per plan.