The Jenkins Mac Agent is reporting low disk space, or builds are failing during writes.

First identify whether workspaces, Xcode components, or build artifacts are consuming space; clean only the confirmed source. If alerts return after controlled cleanup, use real task records to revise workspace policy or reassess the Mac CI node.

This runbook is for enterprise IT leads investigating whether disk alerts threaten CI reliability. Platform engineering leads maintaining Jenkins Mac Agents, workspaces, and Xcode environments should use it before changing cleanup jobs. Engineering directors can use the decision criteria to choose between better retention rules and a different Mac CI capacity plan.

Disk alerts and build failures

A disk alert is evidence of storage pressure, not proof that storage caused a failed build. A failed write, an error during archive creation, and a queued or network-stalled job point to different failure paths. Compare host-level storage observations with the affected build’s stage and timestamp before changing the node.

Jenkins Pipelines can define stages, post-build actions, and agent behavior in the pipeline configuration. The relevant logs and configuration are therefore part of diagnosis, not optional context; start with the Jenkins Pipeline documentation and inspect the actual job that failed.

<
Observed symptomEvidence to collectInitial interpretation
Host reports low available storage, and the build log shows a write or archive failureAvailable space at the failure time, affected path, stage, and build logStorage is a plausible cause; identify the path before cleanup
Build fails without a related write error, while the host has no matching storage alertFailure stage, tool output, network or dependency messages, and host storage recordInvestigate the toolchain, dependency, network, or job configuration first
Builds wait in the queue, but running tasks show no write failureQueue state, agent availability, and task assignmentA queue or agent availability issue may be separate from disk pressure
Disk alerts appear, but no single build failsStorage trend and directory growth over comparable task windowsInvestigate retained workspaces, components, and artifacts before attributing the issue to one job
**Which directories should you inspect first on a Jenkins Mac Agent?** Start with the configured Jenkins workspace, Xcode-managed components and Simulator runtimes, and the paths where your jobs save archives, logs, and test results. Then inspect temporary outputs and caches that your pipeline actually uses. Do not assume a standard path list applies unchanged: verify paths from the agent configuration and job scripts.

For a useful incident record, capture the host’s available and used space, the directories with the largest observed growth, the failed job and stage, and timestamps that let you align host observations with Jenkins logs. These are team-specific measurements, not values that can be inferred from Apple or Jenkins documentation.

Workspace retention

A Jenkins workspace can remain after a build, depending on how the job and cleanup steps are configured. Jenkins documents workspace cleanup as an explicit Pipeline step; review the Workspace Cleanup step reference and the pipeline’s own post-build logic instead of assuming that every completed task removes its files.

Concurrent tasks can also leave distinct working directories or produce overlapping output, depending on how the job is configured. Inspect the agent’s actual workspace layout and the job’s concurrency settings. A workspace that looks old may still be relevant to a running task, a failed build investigation, or a reproduction attempt.

<
Workspace conditionSpace riskDiagnostic valueCleanup approach
Successful build with reproducible inputs and archived outputsRetained workspace may accumulateUsually lower after required outputs are verifiedConsider cleanup after the job’s required outputs and logs are preserved
Failed build under investigationWorkspace may remain while the cause is diagnosedOften useful for reproducing or inspecting the failurePreserve it until the incident owner confirms it is no longer needed
Interrupted or cancelled buildPartial outputs may remainCan explain where a task stoppedIdentify the task state and owner before removing its directory
Concurrent build activityActive workspace may be changingRequired to understand task isolation and output ownershipExclude active workspaces from broad cleanup operations
**Will cleaning a Jenkins workspace remove files you need to keep?** It can remove files inside the selected workspace, so treat cleanup scope as a job-level decision. Jenkins provides cleanup configuration and Pipeline syntax, but your organization defines which outputs must survive for release, audit, or diagnosis. Check the [Pipeline syntax reference](https://www.jenkins.io/doc/book/pipeline/syntax/) against your job configuration, and preserve required artifacts outside any directory targeted for deletion.

For a controlled change, specify what triggers cleanup, which paths it can affect, and what records must be retained. Keep failure evidence long enough for your team’s investigation process. Do not use a general workspace deletion as a substitute for an explicit artifact-retention policy.

Xcode components and Simulator runtimes

Xcode includes components that teams may not need on every build node. Apple documents management of platforms, optional components, and Simulator runtimes through Xcode’s component-management workflow; use the official Xcode components guidance to identify what the installed environment can manage.

Begin by mapping each Xcode version and component to the projects and jobs that use it. A runtime that appears unused on one node may still be needed by another branch, test matrix, or scheduled validation job. Verify the dependency with the project owners and pipeline definitions before removing it.

Can you safely remove an Xcode Simulator runtime? Only when you have confirmed that no active or scheduled job depends on it, and you use Xcode’s supported component-management process. Apple also documents how to add Simulator devices and runtimes. That is useful for understanding the managed workflow, but it does not establish which runtime your team can remove. Do not make manual deletion of protected or managed directories a general cleanup instruction.

<
Xcode-related storage areaWhat to verifySafer decision
Xcode application and installed versionsWhich jobs select each installed version and whether parallel toolchain support is requiredKeep versions referenced by active pipelines; remove only after job owners validate the migration
Platform support and optional componentsWhich project targets and build steps depend on each componentUse Xcode’s component-management interface to assess unused items
Simulator runtimesWhich test jobs select each runtime and whether scheduled suites still require itConfirm job and test dependencies before removing through the supported workflow
Derived or job-generated outputWhether the data is a reusable cache, a temporary output, or evidence needed for diagnosisApply a documented retention rule, then validate a clean build
Treat component removal as a toolchain change, not just a disk operation. Afterward, verify dependency resolution, the selected Xcode version, simulator availability, and a real build path used by the team. Apple’s guidance on [testing a release build](https://developer.apple.com/documentation/Xcode/testing-a-release-build) is relevant when your validation needs to cover release-build behavior rather than only confirming that a project opens.

Build artifacts, logs, and retention

Archives, symbol files, test reports, logs, and temporary outputs do not all have the same retention value. Some can be regenerated; others may be needed to release software, investigate a failure, or meet an internal evidence requirement. Before removing files, identify their owner, purpose, location, and required retention rule.

Apple’s Mac storage guidance describes the available storage-management view in macOS. Use Apple’s storage settings guidance as a host-level aid, then inspect the Jenkins job and artifact destinations to determine what is actually consuming space. A storage summary can help locate pressure, but it does not decide whether a particular build output is safe to discard.

<
Output typeWhy it may need to stayQuestion for the owner
Release archiveMay be needed for distribution or release verificationIs the archive retained in an approved location, and is this local copy required?
Symbols and diagnostic filesMay support post-release crash investigationWhich release or diagnostic process consumes them?
Test reportsMay document a test result or support a failed-build investigationIs the report stored elsewhere, and when may this copy be removed?
Build logsMay be the clearest record of a failure or release processDoes the incident or audit policy require this log?
Temporary output and cachesMay be reproducible, but can affect subsequent build behaviorCan the job recreate it, and has that been verified on this agent?
Separate cleanup of disposable workspace data from retention of release and diagnostic evidence. If artifacts are copied to a managed destination, confirm that the transfer completed and that the retained copy can be found before deleting the local source. Avoid treating a successful upload message as proof unless the team’s process verifies the output itself.

Cleanup rollout and recovery checks

A cleanup rule can free space while also removing the context needed to reproduce a failure. Make the scope narrow, retain the evidence your team needs, and validate the behavior on representative jobs before applying it across agents. The Jenkins cleanup step documentation describes the available step; your job’s configuration still determines when it runs and what it targets.

Use this rollout checklist before making a cleanup policy routine:

  • [ ] Record the agent’s available and used space and the directories showing growth.
  • [ ] Link the observation to the affected Jenkins job, build stage, and failure log.
  • [ ] Identify whether the suspected files belong to an active workspace, a completed task, an Xcode component, or a retained artifact.
  • [ ] Ask the job or release owner which files must remain available for reproduction, release, audit, or diagnosis.
  • [ ] Define cleanup scope and timing so that active workspaces and required evidence are excluded.
  • [ ] Test the rule on a representative job and inspect the resulting workspace and retained outputs.
  • [ ] Run a real build that exercises the relevant dependency resolution, Xcode selection, and Simulator requirements.
  • [ ] Confirm that the logs and artifacts required by your team remain accessible after cleanup.
  • [ ] Document how to disable or revert the rule if builds fail or required evidence disappears.
Treat the change as unverified if the job passes only because it reuses existing local state. The acceptance record should show which cleanup rule ran, which files it affected, what build path was exercised afterward, and whether the expected artifacts and logs remained available.

Recurring alerts and Mac CI capacity

A cleanup that resolves one incident does not prove that the node has enough capacity for its ongoing workload. Compare records from representative periods: directory growth, build and cleanup timing, task overlap, recurrence of alerts, and the artifacts your team must retain. Do not use an assumed free-space threshold or a promised cleanup gain to justify a capacity change.

<
Evidence from the team’s recordsPrefer cleanup-policy changes when…Reassess the Mac CI node when…
Main source of growthA specific completed workspace or disposable output is responsibleGrowth comes from required components, retained evidence, or ongoing task output
Recurrence patternA clear retention gap explains repeated accumulationAlerts return despite verified, scoped cleanup
Task overlapCleanup can be scheduled without affecting active jobsConcurrent tasks compete for the same node and its workspace or output paths
Retention obligationsRequired release and diagnostic files can be stored and retained under an approved policyRequired artifacts and supported toolchains cannot fit within the current operating model
Validation resultRepresentative builds pass after the policy change with required evidence intactBuilds remain affected after cleanup rules and dependencies are verified
**When should recurring alerts lead you to expand or change Mac CI capacity?** Reassess the node when your records show that required components, active work, and retained outputs—not accidental workspace residue—are driving the recurring pressure, or when safe cleanup cannot keep the workload reliable. First test whether workspace isolation, concurrency policy, or artifact storage can address the cause. If those changes cannot meet the team’s requirements, compare the current node with an additional or differently managed Mac CI node using your actual workload and retention rules.

That comparison should include operational constraints as well as storage: who administers the agent, how access is controlled, how jobs are isolated, how toolchains are maintained, and how evidence is retained. If you are considering a remote Mac as part of that assessment, review MACGPU’s available remote Mac options and the MACGPU Mac ordering information, then verify the current configuration, rental period, and delivery details against your team’s requirements. Do not infer a storage guarantee or build-performance outcome from the fact that a Mac is remotely hosted.

Your existing Mac may remain the better fit when the workload is stable, the team needs local physical access, or the organization already has a supported operating model. A remote Mac can be worth evaluating when you need a temporary test environment or want to compare another hosted node without making an immediate hardware purchase. Make that decision from verified job records and the current service details—not from a disk alert alone.