Skip to main content

Real Device Cleaning Process

TestingBot automatically cleans each physical mobile device in the public device pool after every test session. We do this to ensure each new test starts with a clean state, without any leftover data from previous sessions.

The cleaning process we use is automated for both iOS and Android. For devices in the public device pool, each test session automatically ends with a thorough cleaning process where we delete any apps installed by the user, together with various other files and data that were generated.

If you are using a private device, there's the possibility to alter or completely disable the cleaning process. You would for example use this when you want to make sure that a specific state is kept between various test sessions.

Cleaning Process

TestingBot uses a proprietary process to clean its devices. Below are the various processes that happen when a device is being cleaned. Some steps only exist on one platform, because iOS and Android store data differently.

On iOS and Android

  • All apps that have been installed by the customer are deleted. Some applications, which are used by TestingBot to operate the device, are kept.
  • The browser history, open tabs, cached website data, cookies and saved passwords are removed.
  • Accounts that were added during the session (such as an Apple Account or a Google account) are signed out and removed.
  • Media files such as photos, videos and downloaded files are removed from the device.
  • Contacts, messages, calendar events and call history are removed.
  • Notifications are cleared, the clipboard is emptied and running apps are closed.
  • Accessibility features are turned off again, including VoiceOver (iOS), TalkBack (Android), zoom/magnification and inverted colors.
  • Words the keyboard learned during the session, and keyboards that were added, are removed.
  • Any simulated GPS location that was set during the session is removed.
  • The system language, locale and time zone are reset to their defaults (see Default device settings).
  • Dark mode is turned off.

iOS only

  • The Apple Account in Settings, iCloud accounts in Mail and the account used by the App Store (Media & Purchases) are signed out.
  • Configuration profiles that were installed during the session are removed.
  • Passwords saved in the Passwords app (or Settings > Passwords on older iOS versions) are deleted, as are Safari's AutoFill data and Reading List.
  • Notes, Voice Memos, Reminders, FaceTime history and the files stored on the device (On My iPhone/iPad) are removed, including their "Recently Deleted" folders.
  • iOS keeps an app's keychain items even after the app is uninstalled. Before your app is installed for an Appium or Maestro session, TestingBot removes keychain items that a previous session left behind for the same bundle identifier. For Appium, this also covers the apps you install with otherApps. Your app is installed with its own bundle identifier, so app extensions and code or test flows that use the bundle identifier keep working. This step has a time limit: if it cannot finish, the session still starts, but old keychain items for that app may remain.
  • AssistiveTouch is switched off, and on iOS 16 and later display accessibility settings such as Bold Text are reset.

Android only

  • Work profiles and additional users created during the session are removed.
  • CA certificates that were installed during the session are removed.
  • Saved passwords and passkeys stored by Google Play Services (Google Password Manager) are removed.
  • Chrome and Samsung Internet are reset, and Chrome is set to start without its first-run screens.
  • Network settings are reset: Wi-Fi is turned on, airplane mode is turned off, and any HTTP proxy, custom Private DNS hostname or always-on VPN is removed.
  • Battery saver and Do Not Disturb are turned off, and any simulated battery state is reset.
  • The font size is reset to its default, and alarms and timers set during the session are removed.
  • Apps that were made a device administrator during the session lose that role, so they can be uninstalled like any other app.

TestingBot's cleaning process aims to clean as much as possible from the device. If you prefer the guarantee of a pristine device, please consider using a private mobile device.

Data isolation on real iOS devices

Every session on a public iOS device, manual or automated, ends with the full cleaning process above. This is what that means for the data your app and your tests leave behind:

  • App data: your app is uninstalled after the session, and iOS deletes the app's own data with it: its files, databases, caches and preferences.
  • Keychain: keychain items are the exception, because iOS keeps them after an app is uninstalled. For Appium and Maestro sessions, TestingBot resets the keychain of your app, including any keychain access groups your app uses, just before your app is installed, so a new session does not see keychain items that an earlier session stored under the same bundle identifier (subject to the time limit described above).
  • XCUITest: this keychain reset does not run for XCUITest sessions. If your tests depend on an empty keychain, delete the items your app stores in your test's setup.
  • Shared data: resigned apps run without App Groups or iCloud (see iOS App Resigning), so they cannot leave data in a shared App Group container or in iCloud for a later session.
  • Other traces: besides the items listed above, the cleaning also removes Safari favorites, web clips added to the home screen, and the email suggestions Siri picks up from signed-in accounts and offers on email fields.

Default device settings

After cleaning, devices in the public device pool are set back to these defaults. A private device only returns to these defaults if it uses the standard cleaning process:

Setting Default
Language English
Locale / region United States (en_US)
Time zone Europe/Brussels (UTC+1, or UTC+2 during daylight saving time)

Language and locale

Changes you make to the language, region or time zone during a session (for example in the device's Settings app) do not carry over to the next session: the device is reset to the defaults above when the session ends.

To run a test in another language or locale, set it when the session starts with the appium:language and appium:locale capabilities. See Localization testing on iOS and Android for examples and the supported locale codes.

Was this page helpful?
Last updated