Build & Test Workflows
These are multi-step workflow recipes. Each recipe shows a sequence of prompts that work together to accomplish a common development task.
Clean Build and Test
Section titled “Clean Build and Test”A fresh build-and-test cycle, useful when you suspect cached artifacts are causing issues.
-
“Clean the build artifacts for the WeatherApp scheme”
-
“Build WeatherApp for iPhone 16 simulator in Debug mode”
-
“Run all tests for WeatherApp on iPhone 16 simulator”
One-shot version:
“Clean, rebuild, and run all tests for WeatherApp on the iPhone 16 simulator”
Archive and Export IPA
Section titled “Archive and Export IPA”Build an IPA for distribution (TestFlight, App Store, or ad-hoc).
-
Check schemes and settings first:
“List the schemes in my project and show build settings for the Release configuration”
-
Create the archive:
“Archive the WeatherApp scheme to ~/Desktop/WeatherApp.xcarchive”
{"scheme": "WeatherApp","archivePath": "/Users/dev/Desktop/WeatherApp.xcarchive","configuration": "Release"} -
Export the IPA:
“Export an IPA from ~/Desktop/WeatherApp.xcarchive to ~/Desktop/ipa-output using ~/ExportOptions.plist”
{"archivePath": "/Users/dev/Desktop/WeatherApp.xcarchive","exportPath": "/Users/dev/Desktop/ipa-output","exportOptionsPlist": "/Users/dev/ExportOptions.plist"} -
Analyze the output:
“Analyze the exported IPA at ~/Desktop/ipa-output/WeatherApp.ipa”
Run Tests on Specific Simulator
Section titled “Run Tests on Specific Simulator”Target a specific device and OS version for testing.
-
Find the right simulator:
“List all simulators that are shut down”
-
Boot it:
“Boot the iPhone 15 Pro - iOS 17.5 simulator”
-
Run tests:
“Run tests for WeatherApp on the iPhone 15 Pro simulator running iOS 17.5”
{"scheme": "WeatherApp","destination": "platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5"}
Run Only Specific Test Classes
Section titled “Run Only Specific Test Classes”Focus your test run on the area you’re working on.
“Run only the WeatherServiceTests class on iPhone 16 simulator”
{ "scheme": "WeatherApp", "destination": "platform=iOS Simulator,name=iPhone 16,OS=latest", "onlyTesting": ["WeatherAppTests/WeatherServiceTests"]}“Run WeatherServiceTests and LocationManagerTests on iPhone 16”
{ "scheme": "WeatherApp", "destination": "platform=iOS Simulator,name=iPhone 16,OS=latest", "onlyTesting": [ "WeatherAppTests/WeatherServiceTests", "WeatherAppTests/LocationManagerTests" ]}“Run all tests except UI tests on iPhone 16”
{ "scheme": "WeatherApp", "destination": "platform=iOS Simulator,name=iPhone 16,OS=latest", "skipTesting": ["WeatherAppUITests"]}Check Build Settings for Signing Issues
Section titled “Check Build Settings for Signing Issues”Debug code signing problems by inspecting the resolved build settings.
-
“Show build settings for WeatherApp in Release configuration”
Look for these keys in the output:
CODE_SIGN_IDENTITY = Apple Distribution: Your Team (ABC123)DEVELOPMENT_TEAM = ABC123XYZPROVISIONING_PROFILE_SPECIFIER = WeatherApp DistributionCODE_SIGN_STYLE = Manual -
“List my code signing identities”
Verify the identity from step 1 is installed.
-
“List my provisioning profiles”
Verify the profile from step 1 is installed and not expired.
-
If the profile looks wrong:
“Inspect the provisioning profile at ~/Library/MobileDevice/Provisioning Profiles/abc123.mobileprovision”
Resolve and Update Dependencies
Section titled “Resolve and Update Dependencies”Swift Package Manager
Section titled “Swift Package Manager”-
“Show the SPM dependency tree for my project”
Review what packages and versions are currently resolved.
-
“Update all Swift packages to their latest allowed versions”
-
“Resolve SPM dependencies to make sure everything is consistent”
-
“Build my project to verify the updates work”
CocoaPods
Section titled “CocoaPods”-
“Check for outdated CocoaPods in my project”
Review which pods have newer versions available.
-
“Update all pods”
Or update a specific one:
“Update the Alamofire pod”
-
“Run pod install with repo update”
Ensures your local spec repo is current.
-
“Build my project to verify the pod updates work”
Mixed SPM + CocoaPods Project
Section titled “Mixed SPM + CocoaPods Project”“Update all Swift packages and CocoaPods, then rebuild and run tests”
The AI assistant will handle both package managers in sequence.
Run SwiftLint and Auto-Fix
Section titled “Run SwiftLint and Auto-Fix”-
Check current violations:
“Run SwiftLint on my project”
SwiftLint Analysis:12 violations (8 warnings, 4 errors)Sources/WeatherService.swift:45: warning: Line Length (line_length)Sources/LocationManager.swift:12: error: Force Cast (force_cast)... -
Auto-fix what’s possible:
“Auto-fix SwiftLint violations in my project”
SwiftLint auto-fix complete.Fixed 6 violations in 4 files. -
Check what remains:
“Run SwiftLint again to see remaining issues”
The remaining violations need manual fixes (force casts, complex issues).
Full CI-Like Quality Gate
Section titled “Full CI-Like Quality Gate”Simulate what your CI pipeline does, all locally:
“Run the full quality check: clean build, run SwiftLint, check swift-format, run all tests on iPhone 16, and show any build warnings”
- Clean and build
- SwiftLint analysis
- swift-format check
- Run full test suite
- Extract build warnings
This gives you confidence before pushing that your PR will pass CI.