Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkg/driver/devicelab_ios/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ func (d *Driver) launchApp(s *flow.LaunchAppStep) *core.CommandResult {
return res
}
}
d.applyLaunchPermissions(bid, s.Permissions)
if s.ClearKeychain {
if _, err := d.runSimctl("keychain", d.udid, "reset"); err != nil {
logger.Warn("launchApp: clearKeychain skipped: %v", err)
if !keepsRunningApp(s) {
d.applyLaunchPermissions(bid, s.Permissions)
if s.ClearKeychain {
if _, err := d.runSimctl("keychain", d.udid, "reset"); err != nil {
logger.Warn("launchApp: clearKeychain skipped: %v", err)
}
}
}
args := []string{"launch", "--terminate-running-process", d.udid, bid}
Expand Down
5 changes: 1 addition & 4 deletions pkg/driver/devicelab_ios/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestLaunchAppDefaultsAndErrors(t *testing.T) {
if res := d.Execute(&flow.LaunchAppStep{}); res.Success {
t.Fatal("no app id should fail")
}
res := d.Execute(&flow.LaunchAppStep{AppID: "com.x", StopApp: boolp(false)})
res := d.Execute(&flow.LaunchAppStep{AppID: "com.x"})
if res.Success {
t.Fatal("launch error should fail")
}
Expand All @@ -76,9 +76,6 @@ func TestLaunchAppDefaultsAndErrors(t *testing.T) {
if sl.has("privacy SIM-1 reset") {
t.Fatalf("default all:allow must not reset permissions: %v", sl.calls)
}
if sl.has("terminate") {
t.Fatal("stopApp: false must not terminate")
}
}

// stopApp: false launches without --terminate-running-process: Maestro's
Expand Down