Warum remote entwickeln?
Die Remote-Xcode-Entwicklung ist nicht nur für Menschen gedacht, die keinen Mac besitzen. Viele professionelle Teams nutzen Remote-Mac-Server auch dann, wenn sie über lokale Rechner verfügen, wegen der erheblichen Vorteile:
-
Immer laufender Build-Server
Ihr Remote-Mac läuft rund um die Uhr in einem Rechenzentrum. CI/CD-Pipelines, nächtliche Builds und automatisierte Tests laufen, ohne dass Ihr Laptop geöffnet bleiben muss.
-
1Gbps-Netzwerk ohne Traffic-Limit
Netzwerktechnik auf Rechenzentrumsniveau bedeutet schnellere Git-Klone, Downloads von Abhängigkeiten und Uploads von Artefakten. CocoaPods-Installationen und SPM-Auflösungen erfolgen in Sekunden.
-
Einheitliche Umgebung
Jedes Teammitglied verbindet sich mit derselben Serverkonfiguration. Keine „Läuft auf meinem Rechner"-Probleme mehr, verursacht durch unterschiedliche macOS-Versionen oder Xcode-Konfigurationen.
-
Von jedem Gerät aus arbeiten
Nutzen Sie Ihre vollständige Xcode-Entwicklungsumgebung auf einem dedizierten macOS-Server von einem Windows-Laptop, einem Linux-Desktop, einem Chromebook oder sogar einem iPad mit einem SSH-Client aus. Brauchen Sie Xcode nur für einen Build? Mieten Sie einen Mac mini tageweise ab $14/Tag (USD, exkl. Steuern); schalten Sie bei der Bereitstellung die automatische Verlängerung aus, dann endet er nach 24 Stunden.
Methode 1: SSH + xcodebuild-CLI
Der leichtgewichtigste Ansatz. Sie bearbeiten den Code lokal (oder auf dem Server) in Ihrem bevorzugten Editor und erstellen ihn dann mit xcodebuild über SSH. Diese Methode funktioniert von jedem Gerät mit einem Terminal aus.
SSH-Schlüssel einrichten
# Generate SSH key on your local machine (if you don't have one)
ssh-keygen -t ed25519 -C "dev@company.com"
# Copy your public key to the remote Mac
ssh-copy-id user@your-mac.myremotemac.com
# Configure SSH for convenience (~/.ssh/config)
Host mac-dev
HostName your-mac.myremotemac.com
User your-username
IdentityFile ~/.ssh/id_ed25519
ForwardAgent yes
ServerAliveInterval 60
ServerAliveCountMax 3
Compression yes
# Now connect with just:
ssh mac-dev
Gängige xcodebuild-Befehle
# List available schemes
xcodebuild -list -project MyApp.xcodeproj
# Build for iOS Simulator
xcodebuild -project MyApp.xcodeproj \
-scheme MyApp \
-destination 'generic/platform=iOS Simulator' \
clean build
# Build with workspace (CocoaPods/SPM)
xcodebuild -workspace MyApp.xcworkspace \
-scheme MyApp \
-destination 'generic/platform=iOS Simulator' \
build
# Run unit tests (use any device listed by: xcrun simctl list devices available)
xcodebuild test \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
-resultBundlePath ./TestResults.xcresult
# Archive for distribution (App Store Connect requires Xcode 26 or later)
xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath ./build/MyApp.xcarchive \
CODE_SIGN_IDENTITY="Apple Distribution" \
PROVISIONING_PROFILE_SPECIFIER="MyApp Distribution"
# Export IPA from archive
xcodebuild -exportArchive \
-archivePath ./build/MyApp.xcarchive \
-exportPath ./build/ipa \
-exportOptionsPlist ExportOptions.plist
# Upload to App Store Connect
xcrun altool --upload-app \
-f ./build/ipa/MyApp.ipa \
-t ios \
-u "apple-id@example.com" \
-p "@keychain:AC_PASSWORD"
tmux für dauerhafte Sitzungen verwenden
Verwenden Sie tmux, damit Ihre Builds auch dann weiterlaufen, wenn Ihre SSH-Verbindung abbricht.
# Install tmux via Homebrew
brew install tmux
# Start a new tmux session
tmux new -s build
# Run your build inside tmux
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp build
# Detach from tmux: press Ctrl+B, then D
# Your build keeps running on the server
# Reconnect later
ssh mac-dev
tmux attach -t build
Methode 2: VNC für die vollständige GUI
VNC bietet Ihnen vollständigen Zugriff auf den macOS-Desktop, einschließlich der visuellen Oberfläche von Xcode, des Interface Builder, der iOS-Simulatoren im Device Hub und von Instruments. Dies ist die beste Methode, wenn Sie das vollständige Xcode-GUI-Erlebnis benötigen.
Mit der Bildschirmfreigabe verbinden
# My Remote Mac serves Screen Sharing (VNC) on port 59010:
# point your VNC client at YOUR-IP:59010 and sign in with
# your macOS username and password
# On a Mac you manage yourself, turn on Screen Sharing in
# System Settings > General > Sharing. Since macOS 12.1 the
# kickstart command can no longer enable it.
# Verify Screen Sharing is running (over SSH)
sudo launchctl list | grep -i screensharing
Empfohlene VNC-Clients nach Betriebssystem
| Ihr Betriebssystem | Empfohlener Client | Hinweise |
|---|---|---|
| Windows | RealVNC Viewer (kostenlos) | Beste Leistung, unterstützt Apples High-DPI |
| Linux | Remmina oder TigerVNC | Remmina verfügt über integriertes SSH-Tunneling |
| macOS | Integrierte Bildschirmfreigabe | Finder öffnen > Gehe zu > Mit Server verbinden > vnc:// |
| Chromebook | VNC Viewer (Chrome Web Store) | Funktioniert gut für grundlegenden GUI-Zugriff |
| iPad/iPhone | Screens 5 oder RealVNC | Touch-Gesten für die Interaktion mit macOS |
Sicheres VNC über einen SSH-Tunnel
Verwenden Sie für VNC-Verbindungen immer einen SSH-Tunnel, um den gesamten Datenverkehr zu verschlüsseln.
# Create SSH tunnel for VNC (run on your LOCAL machine)
ssh -L 5900:localhost:5900 -N -f mac-dev
# Now connect your VNC client to: localhost:5900
# All traffic is encrypted through the SSH tunnel
# On Windows with PuTTY:
# Connection > SSH > Tunnels
# Source port: 5900
# Destination: localhost:5900
# Click "Add", then connect
VNC-Optimierungstipps
- Bildschirmauflösung verringern: Stellen Sie den Remote-Mac auf 1920x1080 statt auf Retina ein, um schneller zu rendern.
- Farbtiefe reduzieren: Stellen Sie in Ihrem VNC-Client die Farbqualität auf Mittel oder 16-Bit für bessere Leistung ein.
- Transparenz deaktivieren: Gehen Sie auf dem Remote-Mac zu Systemeinstellungen > Bedienungshilfen > Anzeige > Transparenz reduzieren.
- Unnötige Apps schließen: Jedes geöffnete Fenster erhöht die Bildschirmdaten, die übertragen werden müssen.
- SSH-Komprimierung verwenden: Fügen Sie
Compression yeszu Ihrer SSH-Konfiguration für den Tunnel hinzu.
Methode 3: VS Code Remote SSH
VS Code Remote SSH bietet Ihnen das Beste aus beiden Welten: die Reaktionsschnelligkeit eines lokalen Editors mit der Rechenleistung eines Remote-Macs. Ihre Tastenanschläge sind lokal, Ihre Builds laufen auf dem Server.
Installieren und konfigurieren
# Step 1: Install VS Code extensions
# Open VS Code and install these extensions:
# - Remote - SSH (ms-vscode-remote.remote-ssh)
# - Swift (sswg.swift-lang)
# - CodeLLDB (vadimcn.vscode-lldb) - for debugging
# Step 2: Configure SSH in ~/.ssh/config
Host mac-dev
HostName your-mac.myremotemac.com
User your-username
IdentityFile ~/.ssh/id_ed25519
ForwardAgent yes
ServerAliveInterval 60
# Step 3: Connect
# Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)
# Type: "Remote-SSH: Connect to Host"
# Select: mac-dev
# VS Code installs its server component on the remote Mac
# Open your project folder
Build-Aufgaben konfigurieren
Erstellen Sie eine .vscode/tasks.json in Ihrem Projekt, um xcodebuild aus VS Code auszuführen:
{
"version": "2.0.0",
"tasks": [
{
"label": "Build iOS (Simulator)",
"type": "shell",
"command": "xcodebuild",
"args": [
"-workspace", "MyApp.xcworkspace",
"-scheme", "MyApp",
"-destination", "generic/platform=iOS Simulator",
"build"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$xcodebuild"]
},
{
"label": "Run Tests",
"type": "shell",
"command": "xcodebuild",
"args": [
"test",
"-workspace", "MyApp.xcworkspace",
"-scheme", "MyApp",
"-destination", "platform=iOS Simulator,name=iPhone 17,OS=latest"
],
"group": "test",
"problemMatcher": ["$xcodebuild"]
},
{
"label": "Clean Build",
"type": "shell",
"command": "xcodebuild",
"args": [
"-workspace", "MyApp.xcworkspace",
"-scheme", "MyApp",
"clean"
],
"problemMatcher": []
}
]
}
Nun können Sie Ctrl+Shift+B (oder Cmd+Shift+B) drücken, um einen Build auszulösen, und die Ausgabe erscheint im integrierten Terminal von VS Code.
Swift-Sprachunterstützung in VS Code
# On the remote Mac, install SourceKit-LSP (comes with Xcode)
# Verify it's available:
xcrun sourcekit-lsp --help
# VS Code Swift extension will automatically detect SourceKit-LSP
# You get:
# - Code completion for Swift and SwiftUI
# - Jump to definition
# - Find references
# - Inline error diagnostics
# - Symbol search
Methode 4: JetBrains-IDEs über SSH (Toolbox App)
JetBrains bietet keine IDE mehr für Swift- und Xcode-Projekte an: AppCode wurde eingestellt (Updates und Support endeten am 31. Dezember 2023), und Fleet wird nicht mehr vertrieben (seit dem 22. Dezember 2025). Für Swift nutzen Sie Xcode über VNC oder VS Code Remote SSH. Die Remote-Entwicklung von JetBrains hilft weiterhin, wenn Ihr Repository auch Kotlin-Multiplatform-, Backend- oder Web-Code enthält: Die JetBrains Toolbox App verbindet sich per SSH mit einem Mac und führt dort das Backend einer IntelliJ-basierten IDE aus, während ein Thin Client die Oberfläche lokal rendert (JetBrains Gateway funktioniert nur mit Linux-Backends).
Eine JetBrains-IDE mit der Toolbox App verbinden
# JetBrains Gateway only connects to Linux backends: a Mac host
# goes through the JetBrains Toolbox App instead
# Step 1: Install the Toolbox App on your local machine
# (jetbrains.com/toolbox-app)
# Step 2: Create the SSH connection
# In the Toolbox App: SSH > New SSH Connection
# Server: your-username@your-mac.myremotemac.com
# (the Toolbox App uses OpenSSH, so your ~/.ssh/config keys apply)
# Step 3: Install the IDE backend on the remote Mac
# Open the server's Tools tab and pick an IntelliJ-based IDE
# (for example IntelliJ IDEA for Kotlin Multiplatform)
# Step 4: Open your project folder on the remote Mac
# Keep editing Swift in Xcode (Method 2) or VS Code (Method 3)
Tipp: Die Remote-Entwicklung von JetBrains funktioniert am besten mit einer stabilen Internetverbindung (mindestens 10 Mbps). Der Thin Client rendert die Benutzeroberfläche lokal, sodass sich das Erlebnis auch über große Entfernungen reaktionsschnell anfühlt.
Code-Signierung remote verwalten
Die Code-Signierung ist einer der kniffligsten Teile der Remote-iOS-Entwicklung. So verwalten Sie Zertifikate und Provisioning-Profile auf Ihrem Remote-Mac-Server.
Zertifikate aus dem Apple Developer Portal exportieren
# Option 1: Export from existing Mac as .p12
# On your local Mac (if you have one):
# Open Keychain Access > My Certificates
# Right-click your distribution certificate > Export
# Save as .p12 with a strong password
# Transfer to remote Mac
scp ~/Desktop/Certificates.p12 mac-dev:~/
# On the remote Mac, import:
security import ~/Certificates.p12 \
-k ~/Library/Keychains/login.keychain-db \
-P "your-p12-password" \
-T /usr/bin/codesign -T /usr/bin/security
# Allow codesign access without password prompts
security set-key-partition-list \
-S apple-tool:,apple:,codesign: \
-s -k "your-login-password" \
~/Library/Keychains/login.keychain-db
# Option 2: Create new certificate on remote Mac
# Use VNC to open Xcode > Settings > Accounts
# Add your Apple ID
# Xcode manages certificates automatically
Keychain-Verwaltung für CI/CD
# Create a dedicated keychain for CI/CD
security create-keychain -p "keychain-password" build.keychain-db
# Set it as the default keychain
security default-keychain -s build.keychain-db
# Unlock the keychain (needed for automated builds)
security unlock-keychain -p "keychain-password" build.keychain-db
# Set keychain timeout to prevent auto-lock during builds
security set-keychain-settings -t 3600 -u build.keychain-db
# Import certificate
security import Certificates.p12 \
-k build.keychain-db \
-P "p12-password" \
-T /usr/bin/codesign
# Let codesign use the key without a prompt (needed over SSH)
security set-key-partition-list \
-S apple-tool:,apple:,codesign: \
-s -k "keychain-password" build.keychain-db
# Add to search list
security list-keychains -s build.keychain-db login.keychain-db
# Verify
security find-identity -v -p codesigning build.keychain-db
Provisioning-Profile
# Download profiles from Apple Developer Portal
# Or use the xcodebuild automatic provisioning:
# Install provisioning profiles manually
# (Xcode 16 and later read them from this folder; older versions
# used ~/Library/MobileDevice/Provisioning Profiles)
mkdir -p ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/
cp MyApp_Distribution.mobileprovision \
~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/
# List installed profiles
ls ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/
# Decode profile info
security cms -D -i ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/MyApp_Distribution.mobileprovision
Strategien zur Dateisynchronisierung
Wählen Sie die richtige Strategie zur Dateisynchronisierung basierend auf Ihrem Workflow.
Git (empfohlen)
Der einfachste und zuverlässigste Ansatz. Lokal bearbeiten, in ein Repository pushen, auf dem Remote-Mac pullen.
# Local machine: push changes
git add . && git commit -m "Update views" && git push
# Remote Mac: pull and build
ssh mac-dev "cd ~/MyApp && git pull && xcodebuild build"
rsync (schnelle Synchronisierung)
Synchronisiert nur geänderte Dateien über SSH. Schneller als das Kopieren ganzer Verzeichnisse.
# Sync local project to remote Mac
rsync -avz --exclude '.git' --exclude 'DerivedData' \
--exclude 'build' --exclude '.DS_Store' \
./MyApp/ mac-dev:~/MyApp/
# Watch for changes and auto-sync (using fswatch on macOS/Linux)
fswatch -o ./MyApp/Sources/ | while read; do
rsync -avz ./MyApp/Sources/ mac-dev:~/MyApp/Sources/
done
SSHFS (Remote-Dateisystem einhängen)
Hängen Sie das Dateisystem des Remote-Macs als lokales Laufwerk ein. Bearbeiten Sie Dateien, als wären sie lokal.
# Install SSHFS
# Linux: sudo apt install sshfs
# macOS: brew install macfuse sshfs
# Windows: Install WinFsp + SSHFS-Win
# Mount remote directory
mkdir ~/remote-mac
sshfs mac-dev:/Users/your-username/MyApp ~/remote-mac
# Edit files locally -- they are actually on the remote Mac
code ~/remote-mac
# Unmount when done
fusermount -u ~/remote-mac # Linux
umount ~/remote-mac # macOS
Performance-Tipps
Optimieren Sie Ihr Remote-Entwicklungserlebnis mit diesen Einstellungen.
SSH-Komprimierung
Aktivieren Sie die Komprimierung in Ihrer SSH-Konfiguration, um die Datenübertragung zu reduzieren.
# ~/.ssh/config
Host mac-dev
Compression yes
CompressionLevel 6
SSH-Multiplexing
Verwenden Sie SSH-Verbindungen wieder, um Verzögerungen durch erneutes Verbinden zu vermeiden.
# Create the socket folder once: mkdir -p ~/.ssh/sockets
# ~/.ssh/config
Host mac-dev
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
DerivedData auf einer RAM-Disk
Verschieben Sie Xcodes DerivedData auf eine RAM-Disk für schnellere Builds. Halten Sie sie klein und nutzen Sie sie nur auf Macs mit 24 GB oder mehr: Die Disk wird bei jedem Neustart gelöscht.
# Create a 4 GB RAM disk (24 GB+ Macs only;
# it is erased at every restart)
diskutil erasevolume HFS+ \
"RAMDisk" $(hdiutil attach \
-nomount ram://8388608)
# Point Xcode DerivedData to RAM disk
defaults write com.apple.dt.Xcode \
IDECustomDerivedDataLocation \
/Volumes/RAMDisk/DerivedData
Lokales Caching mit Mosh
Verwenden Sie Mosh statt SSH für bessere Reaktionsschnelligkeit bei instabilen Verbindungen.
# Install Mosh on both machines
brew install mosh
# Connect (handles roaming and sleep)
mosh user@your-mac.myremotemac.com
VNC-Auflösungseinstellungen
# Set a lower resolution for better VNC performance
# On the remote Mac, install displayplacer (Homebrew core)
brew install displayplacer
# List current display settings (note the display id)
displayplacer list
# Apply 1920x1080, using the id shown by the list command
displayplacer "id:1 res:1920x1080 hz:60 color_depth:8 scaling:off"
Häufig gestellte Fragen
Welche Methode soll ich wählen: SSH, VNC oder VS Code?
Kann ich die SwiftUI-Vorschau von Xcode remote nutzen?
Wie viel Bandbreite verbraucht VNC?
Kann ich mehrere Simulator-Instanzen remote ausführen?
xcrun simctl, um Simulator-Instanzen über die Befehlszeile zu verwalten.Was passiert, wenn meine SSH-Verbindung während eines Builds abbricht?
tmux oder screen verwenden, läuft der Build weiter auf dem Server, und Sie können sich erneut mit der Sitzung verbinden. Ohne tmux wird der Build-Prozess beendet. Wir empfehlen dringend, Builds immer innerhalb einer tmux-Sitzung auszuführen.