I have some iOS devices in a device farm that I'm trying to automate as much as possible. I'd like to be able to clean them after use (i.e. restore them to a set state) without having to physically interact with the devices.

So far, I've found I can do this:

  1. Install idevicebackup2 from libimobiledevice
  2. Run idevicebackup2 backup /tmp/iphonebackup
  3. Run idevicebackup2 restore /tmp/iphonebackup --system --reboot
  4. Wait for reboot

After the reboot, "Update Complete", then "Welcome to iPhone" screens are present. These interfere with automated operation of the device (e.g. launching apps). I hoped I could launch an XCUITest to navigate through this pointless wizard but I get Could not launch “WebDriverAgent”: Unlock the device “iPhone” and repeat the action in Xcode when attempting this.

Is it possible to skip this setup wizard after restoring settings? Or is there another way to reset the phone to a state where I can interact with it from the command line successfully?

You must log in to answer this question.

Browse other questions tagged .