syncApp function for continuous app development. It syncs an iOS app folder to a remote instance using efficient binary diffing, reloads the app, and streams logs in real-time - similar to developing locally with Xcode.
What This Example Does
- Creates an iOS instance
- Uploads an iOS app bundle to the instance
- Installs and launches the app
- Watches for local file changes (in watch mode)
- Sends only changed bytes using xdelta3 patches
- Reloads the app automatically
- Streams app logs and system logs
Efficiency
For example, a native Swift app with a 25MB binary has a string change:- Traditional: Re-upload entire 25MB
- Limrun syncApp: Send only 1KB patch, applied in milliseconds
Prerequisites
Install xdelta3
Set API Key
Build Your iOS App
Build your app for the iOS simulator:Running the Example
One-Time Sync
Sync the app once without watching for changes:Continuous Sync (Watch Mode)
Continuously sync changes as you rebuild:xcodebuild, it will:
- Calculate the byte diff
- Send patches to the instance
- Apply patches
- Relaunch the app
Complete Example Code
How It Works
Binary Diffing with xdelta3
ThesyncApp function uses the xdelta3 algorithm to calculate binary diffs:
- Reads current app bundle files
- Compares with previously synced version
- Generates compact patches for changed files
- Sends only patches over the network
- Server applies patches to reconstruct files
Launch Modes
ThelaunchMode parameter controls app behavior:
RelaunchIfRunning- Restart app after sync if it was runningForegroundIfRunning- Bring app to foreground without restartNone- Just sync files, don’t touch app state
Watch Mode
In watch mode, the SDK monitors the app folder for changes:Log Streaming
The example demonstrates three log streaming methods:App Logs (Live Stream)
System Logs (Live Stream)
Historical Logs
Development Workflow
Initial Setup
- Build your iOS app for simulator
- Start the sync in watch mode
- Open the instance in Limrun Console to see your app
Iterative Development
- Make code changes in Xcode
- Build the app (
Cmd+Borxcodebuild) - Watch the terminal for sync progress
- See app reload automatically in the instance
- Monitor logs in real-time
Debugging
Use the log streams to debug without Xcode:streamAppLog()- Your app’s console outputstreamSyslog()- System-level events and crashesappLogTail()- Quick snapshot of recent logs
Performance
Sync Speed
For typical development changes:- String/code change: ~100ms (1-2KB patch)
- Asset update: ~500ms (depends on asset size)
- Full binary rebuild: ~2-3s (full upload fallback)
Network Efficiency
- Only changed files are processed
- Only changed bytes within files are sent
- Compression applied to patches
Use Cases
- Remote iOS Development: Develop iOS apps on Windows/Linux
- Team Sharing: Share live app state with teammates
- CI/CD Testing: Rapid iteration on simulator tests
- App Debugging: Access logs without USB connection
Troubleshooting
xdelta3 Not Found
App Doesn’t Reload
Make surelaunchMode is set correctly:
Slow Syncs
First sync is always full upload. Subsequent syncs should be fast. If not:- Check network connection
- Verify xdelta3 is installed
- Try rebuilding from clean state
Next Steps
iOS Instance Client
Explore all iOS instance client methods
Xcode Sandbox
Learn about Xcode sandbox and hot reload