From 220c7fe1d70c812e49fe437ee104edfad39b6c32 Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 16 Aug 2026 01:03:48 +0530 Subject: [PATCH] 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. --- internal/driver/ioscompanion/device.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/driver/ioscompanion/device.go b/internal/driver/ioscompanion/device.go index de10374..1fa428f 100644 --- a/internal/driver/ioscompanion/device.go +++ b/internal/driver/ioscompanion/device.go @@ -243,13 +243,11 @@ func (d *Driver) devicectlReinstall(ctx context.Context) error { return nil } -// deviceResetContainerUnsupported warns once that device clear-state needs an -// app path for a devicectl reinstall: there is no simulator-style data-container -// wipe on a physical device. +// deviceResetContainerUnsupported ends the run: there is no simulator-style +// data-container wipe on a physical device, so a clear-state with no app path +// 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 { - if !d.clearStateWarned { - fmt.Fprintln(d.output, "clear-state on a physical device requires --ios-app-path for a reinstall; skipping (state not cleared)") - d.clearStateWarned = true - } - return nil + return errors.New("clear-state on a physical device requires --ios-app-path for a reinstall; " + + "there is no data-container wipe on a device, so the run would start on the previous run's state") }