Repository navigation
fix(devicelab_ios): skip launch permissions and clearKeychain on stopApp: false - #261
Merged
Merged
Conversation
…App: false When launchApp runs with stopApp: false to foreground a running app, applying launch permissions (simctl privacy grant all) or resetting keychain triggers iOS TCC to terminate the running process with OS_REASON_TCC, preventing stopApp: false from keeping the app alive. Skip permission application and keychain reset when keepsRunningApp(s) is true.
omnarayan
pushed a commit
that referenced
this pull request
Nov 12, 2026
…nd clearKeychain Refs #261
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue in the DeviceLab iOS driver where
launchAppwithstopApp: falseterminated running applications instead of bringing them to the foreground.applyLaunchPermissions(which runssimctl privacy grant all) andclearKeychainwere being executed unconditionally before checkingkeepsRunningApp(s).On iOS, mutating privacy permissions via
simctl privacyprompts the TCC daemon (tccd) to immediately kill the process withOS_REASON_TCC | Access to service kTCCServiceAll changed. As a result, the subsequentsimctl launchcommand spawned a fresh process from scratch instead of foregrounding the existing one, discarding any in-memory app state.Type of Change
Changes Made
pkg/driver/devicelab_ios/lifecycle.go: WrappedapplyLaunchPermissionsandClearKeychaininif !keepsRunningApp(s)so that bringing an app to the front does not reset/grant permissions or reset the keychain.pkg/driver/devicelab_ios/lifecycle_test.go: UpdatedTestLaunchAppDefaultsAndErrorsto assertall: allowdefault permissions on a standard launch (StopApp: nil) rather thanStopApp: boolp(false).TestLaunchAppStopAppFalseKeepsRunningAppcontinues to verify thatstopApp: falsebrings the app forward without termination.Related Issues
Aligns implementation with documented behavior in
CHANGELOG.md("DeviceLab iOS:launchAppwithstopApp: falsebrings a running app to the front instead of restarting it, as Maestro does").Testing
make test/go test ./pkg/driver/devicelab_ios/...)gofmt,go vet ./pkg/driver/devicelab_ios/...)Checklist
Additional Notes
Verified with
simctl spawn log show --predicate 'process == "tccd" or process == "runningboardd"'that iOS no longer terminates the running bundle ID when foregrounded withstopApp: false.