Fix: Xcode 27 Upload Hangs at Preparing to Upload Stage

Fix: Xcode 27 Upload Hangs at Preparing to Upload Stage

Written by

in

Quick answer: The upload hang is caused by the ContentDelivery framework using an outdated Command Line Tools installation that contains an x86_64 binary incompatible with Apple Silicon. To fix this, remove the legacy Command Line Tools directory, reset the xcode-select path to point to your Xcode application, and reinstall the Command Line Tools.

Why this happens

The process of archiving and uploading an iOS application to App Store Connect relies on several internal Apple frameworks, most notably the ContentDelivery framework. During the final stages of the build process, specifically when Xcode reaches the ‘Preparing to upload’ status, the system utilizes a utility called swinfo. This utility is responsible for analyzing the compiled application package (the IPA) to generate necessary metadata and asset descriptions.

swinfo relies on dwarfdump-classic to perform this package analysis. In recent versions of Xcode, especially those running on Apple Silicon (M-series chips), the build tools are tightly integrated. The hang occurs when Xcode attempts to invoke dwarfdump-classic via xcrun. If the system finds an older, residual installation of the Command Line Tools (CLT)—often remnants from previous macOS migrations or updates—it may attempt to use that version instead of the one bundled with the current Xcode.

This legacy CLT installation often contains binaries compiled for the Intel architecture (x86_64). When an Apple Silicon Mac tries to execute this x86_64 binary without the necessary Rosetta translation layer being correctly configured or available in that specific context, the process fails silently. swinfo does not receive a clear error code from this failed launch; instead, it enters an indefinite wait state, causing the entire upload process to hang indefinitely.

How to fix it

This issue is typically resolved by ensuring that the system exclusively uses the Command Line Tools bundled with your current, active Xcode installation, eliminating any conflicting or outdated system-wide installations.

1. Remove Legacy Command Line Tools

The first step is to completely purge any old or corrupted Command Line Tools installations that may be interfering with the process. This ensures that the system cannot fall back to an incompatible version.

Execute the following command in the Terminal:

sudo rm -rf /Library/Developer/CommandLineTools

2. Reset the Xcode Developer Path

After removing the old tools, you must explicitly tell the system where your current, correct Xcode application resides. This is done by resetting the xcode-select path. Assuming your Xcode application is installed in the standard /Applications directory:

xcode-select -s /Applications/Xcode.app/Contents/Developer

3. Install Fresh Command Line Tools

Finally, you must install a clean, modern version of the Command Line Tools that matches your current Xcode version. This will populate the necessary paths and provide the correct, architecture-compatible binaries for swinfo to use.

xcode-select --install

Follow the prompts to complete the installation. Once the installation is finished, restart Xcode and attempt the archive and upload process again.

How to prevent it

  • Keep Xcode and macOS updated: Ensure your Xcode version is compatible with your current macOS version, as Apple frequently updates build tools to support new architectures and frameworks.
  • Avoid mixing CLT versions: Do not manually install or modify Command Line Tools unless specifically required for a non-Xcode development task. Always rely on the version linked via xcode-select.
  • Verify xcode-select path: Periodically check that your system is pointing to the correct Xcode installation by running xcode-select -p and ensuring the output matches your Xcode application path.

FAQ

Why does the upload hang at ‘Preparing to upload’ specifically?

This stage is when Xcode invokes the ContentDelivery framework to analyze the final application package. The hang indicates that the underlying utility (swinfo) required for this analysis is failing or timing out while attempting to execute a required binary, usually due to an architectural mismatch or missing dependency.

Did I need to revoke my Apple Developer certificate for this fix?

No. While certificate issues can cause upload failures, the hang at the ‘Preparing to upload’ stage is an internal build tool failure (related to swinfo and dwarfdump-classic). Revoking certificates addresses authentication issues, not package analysis failures.

Can I use Rosetta to run the old Command Line Tools instead?

While Rosetta allows x86_64 binaries to run on Apple Silicon, relying on an old, unmanaged installation of Command Line Tools is inherently unstable. The recommended fix is to eliminate the conflict entirely by removing the legacy tools and installing a fresh, modern set that aligns with your current Xcode environment.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.