workflow-fresh-install
Build, install, and launch an app on a fresh simulator with one call. Automates simulator shutdown, optional data wipe, boot, build, install, and launch for a clean installation cycle.
Instructions
workflow-fresh-install
Clean slate app installation - build, install, and launch with fresh simulator state.
Overview
Orchestrates a complete clean installation cycle in a single call:
Select Simulator - Auto-detect or use specified device
Shutdown - Ensure simulator is stopped
Erase (optional) - Wipe all simulator data
Boot - Start fresh simulator
Build - Compile the Xcode project
Install - Install the built app
Launch - Start the app
This workflow keeps intermediate results internal, reducing agent context usage by ~70% compared to calling each tool manually.
Parameters
Required
projectPath (string): Path to .xcodeproj or .xcworkspace
scheme (string): Build scheme name
Optional
simulatorUdid (string): Target simulator - auto-detected if omitted
eraseSimulator (boolean): Wipe simulator data before install (default: false)
configuration ("Debug" | "Release"): Build configuration (default: Debug)
launchArguments (string[]): App launch arguments
environmentVariables (Record<string, string>): App environment variables
Returns
Consolidated result with:
success: Overall workflow success
project: Build configuration details
simulator: Target simulator info
app: Installed app details (bundleId, path, launched)
totalDuration: Total workflow time
guidance: Next steps
Examples
Basic Fresh Install
{
"projectPath": "/path/to/MyApp.xcodeproj",
"scheme": "MyApp"
}Auto-selects simulator, builds, installs, and launches.
Clean Install with Erased Simulator
{
"projectPath": "/path/to/MyApp.xcworkspace",
"scheme": "MyApp",
"eraseSimulator": true,
"configuration": "Debug"
}Erases all simulator data for truly fresh state.
Specific Simulator with Launch Arguments
{
"projectPath": "/path/to/MyApp.xcodeproj",
"scheme": "MyApp",
"simulatorUdid": "ABC123-DEF456",
"launchArguments": ["-UITesting", "-ResetState"],
"environmentVariables": {"DEBUG_MODE": "1"}
}Targets specific simulator with custom launch configuration.
Why Use This Workflow?
Token Efficiency
Manual approach: 6-7 tool calls × ~100 tokens each = ~600+ tokens in responses
Workflow approach: 1 call with consolidated response = ~150 tokens
Reduced Context Pollution
Build logs not exposed (only success/failure)
Intermediate states summarized
Only actionable outcome returned
Consistent State
Shutdown ensures clean starting point
Optional erase for truly fresh state
Proper boot sequencing
Related Tools
workflow-tap-element: UI interaction after install
xcodebuild-build: Direct build (used internally)
simctl-device: Direct simulator control (used internally)
simctl-app: Direct app management (used internally)
Notes
Shutdown failures are non-fatal (simulator may already be off)
Auto-suggests best simulator based on project requirements
Build artifacts are located automatically
Bundle ID is discovered from build settings
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to .xcodeproj or .xcworkspace | |
| scheme | Yes | Build scheme name | |
| simulatorUdid | No | Target simulator | |
| eraseSimulator | No | Wipe simulator data | |
| configuration | No | Debug | |
| launchArguments | No | ||
| environmentVariables | No |