Mac hosting guide

Debug Swift Concurrency on a Remote Mac Workflow

Profile with the Swift Concurrency template (Product → Profile), pin the stuck task, and read its Narrative View. If the remote desktop is slow, record headlessly with xcrun xctrace and open the trace locally.

Figment editorial teamPublished Updated Facts checked November 10, 2026

Figment Mac plans

US East. Pay before use. Hourly and daily too.

Intel Mac VM4 shared vCPUs, 4GB RAM, 80GB SSD$25per monthApple Silicon Mac VM4 shared vCPUs, 4GB RAM, 65GB SSD$39per monthDedicated M4 Pro12-core CPU, 24GB RAM, 512GB SSD$199per month

Minimum first purchase: $25 of account credit, used for your rental.

To find why an async task never returns, profile the app with Xcode's Swift Concurrency template in Instruments (Product → Profile), pin the stuck task, and read its Narrative View. The usual shapes are an async function that never finishes, a frozen @MainActor view, or throughput that collapses under load. The fix is rarely a guess at the call site. It is a few minutes with the Swift Tasks and Swift Actors instruments, then one targeted code change.

How do I capture a Swift Concurrency trace?

Open the project in Xcode on the remote Mac, choose Product → Profile and pick the Swift Concurrency template. Run the scenario that triggers the stall. Instruments shows the Swift Tasks, Swift Actors and task forest tracks side by side. Right-click a task in the timeline and pin it to open the Narrative View, which explains why that task is Running, Enqueued or Waiting. Apple walks through the template in the WWDC22 session Visualize and optimize Swift Concurrency.

What if the remote desktop is too slow to profile?

Record the trace headlessly over SSH, then download the .trace bundle and open it in Instruments on your local Mac:

# On the remote Mac. Order matters: --launch is last and ends the record command.
xcrun xctrace record \
  --template 'Swift Concurrency' \
  --time-limit 30s \
  --output ~/Desktop/concurrency.trace \
  --launch -- /path/to/YourApp.app/Contents/MacOS/YourApp

All task and actor data is embedded in the trace file, so you do not need to stay connected to analyze it.

Which check explains a stuck task?

Work through this worksheet in order. Each row maps to a place in Instruments or a specific code change.

CheckWhat to look forTool or change
Task Waiting indefinitelyA withCheckedContinuation whose closure returns without calling resumeSwift Tasks → Narrative View; Xcode runtime warning "leaked continuation"
Main actor blockedA @MainActor method doing sync I/O or long computeSwift Tasks → State track on the main thread; move work to an actor or Task.detached
Actor contentionMany tasks stacked Enqueued behind one long method on the same actorSwift Actors instrument; mark pure functions nonisolated
Cooperative pool starvationRunning task count stays pinned at core count with no progressRunning Tasks graph; find blocking syscalls inside async code
Wrong isolation at runtimeUnexpected hops or data racesAdd MainActor.assertIsolated() at the suspect site; enable SWIFT_STRICT_CONCURRENCY=complete and fix the warnings
Priority inversionHigh-priority task waiting on a low-priority actorTask forest view; raise the actor's effective priority or split its state

One pass through the table usually points at a single change: move compute off the main actor, mark a helper nonisolated, or resume a continuation on the error path. Re-run the same trace to confirm the stall is gone instead of timing a flaky scenario by wall clock.

Which editor should I use for Swift on a remote Mac?

Xcode on the remote Mac, for concurrency debugging, because Instruments and its Swift Tasks and Swift Actors tracks live there. JetBrains Fleet is no longer a safe recommendation: downloads were retired on 22 December 2025 and existing installs have no guaranteed future updates. JetBrains AppCode was retired earlier. Three paths work for Swift today:

  • Xcode directly on the remote Mac, over remote desktop. This is the only path that gives you Instruments, the simulator and the project templates in one place.
  • VS Code or Cursor with sourcekit-lsp, over SSH remote editing, if you mostly want code intelligence and run builds from a terminal.
  • Your existing JetBrains IDE for non-Swift parts of the codebase, with Xcode on the remote Mac reserved for build, sign and profile.

How do I keep the evidence useful afterwards?

Attach the captured .trace to the ticket that reported the stall, so the next engineer starts with evidence rather than a reproduction script. If you run CI on the same Mac, keep signing secrets in your CI service's secret manager rather than exporting them into shell files on the host, and keep the Xcode version pinned to the one used when the trace was captured.

Where should a Swift Concurrency Instruments session run?

The Apple Silicon Mac VM ($39 a month, $6 a day, 4GB RAM) runs current Xcode and is the natural seat for an interactive Instruments session in the browser desktop. If your project builds on Xcode 26.3 or earlier, the Intel Mac VM ($25 a month, $2 a day) also has the Swift Concurrency template. Check the macOS version shown before purchase against Apple's Xcode table. VM vCPUs are shared, so compare traces taken under the same load.


Related: Upload dSYMs to App Store Connect from a Remote Mac · Debug Core Data Issues on a Rented Remote Mac · GitHub Actions Self-Hosted Runner on Mac

Which Figment Mac fits this work?

Intel Mac VM from $25 a month, Apple Silicon Mac VM from $39, or a Dedicated M4 Pro for $199. Hourly and daily plans too. You pay before use, starting with at least $25 of account credit.

Choose a Mac plan