fix(ios): a device clear-state that cannot happen must fail

--clear-data on a physical device with no --ios-app-path warned and then
ran anyway, so the run started on the previous run's data while the flag
said it started clean. There is no data-container wipe on a device, so
there is nothing to fall back to.
This commit is contained in:
pj committed 2026-08-16 01:03:48 +05:30
1 parent 9ede9dc3e2
commit 220c7fe1d7
1 file changed
+6 -8
+6 -8
View File
@@ -243,13 +243,11 @@ func (d *Driver) devicectlReinstall(ctx context.Context) error {
return nil return nil
} }
// deviceResetContainerUnsupported warns once that device clear-state needs an // deviceResetContainerUnsupported ends the run: there is no simulator-style
// app path for a devicectl reinstall: there is no simulator-style data-container // data-container wipe on a physical device, so a clear-state with no app path
// wipe on a physical device. // to reinstall from cannot happen. Warning and carrying on hands the run every
// previous run's data while the flag says it started clean.
func (d *Driver) deviceResetContainerUnsupported(context.Context) error { func (d *Driver) deviceResetContainerUnsupported(context.Context) error {
if !d.clearStateWarned { return errors.New("clear-state on a physical device requires --ios-app-path for a reinstall; " +
fmt.Fprintln(d.output, "clear-state on a physical device requires --ios-app-path for a reinstall; skipping (state not cleared)") "there is no data-container wipe on a device, so the run would start on the previous run's state")
d.clearStateWarned = true
}
return nil
} }