Skip to main content

Overview

Restart App fully terminates the app and relaunches it for a clean cold start. Unlike Activate App, which only brings an already-running app back to the foreground, Restart App kills the process first. The app then comes up in its initial state. Use it for steps that test cold-start or first-launch behavior, or to recover from a wedged screen.

How to use

Write a step in plain language:
  • Restart the app
  • Kill and relaunch the app
  • Cold start the app

Restarting a different app

By default Restart App targets the app under test. To restart (launch) a different app, include its identifier in the step:
  • iOS — the app’s bundle id, e.g. Restart app com.apple.Preferences
  • Android — the app’s package name, e.g. Restart app com.android.settings
This is the supported way to open another app mid-test (for example, the system Settings app to toggle a permission, then returning to your app).
Phrase it as restart or relaunch (not “open” or “activate”) and include the literal bundle id / package name. The agent then launches it as a fresh app instead of trying to tap an icon.
After launching a system app such as Settings, you can drive its UI with normal taps and types. When you’re done, restart your own app (by its bundle id / package name) or use Activate App to return to the app under test.

Restarting with launch arguments or app settings

Two step types restart the app under test with values for one test. Start the step with the exact wording below, then add the values. The wording tells Spur which step to run. If you’re not sure which one an app uses, check the app’s Settings or debug-menu page. If the value appears there, use settings.
Keep the restart as its own step and put the next action in the following step. If an app closes or does not come to the front after the restart, the step fails instead of continuing without the values. This can happen when an app does not accept launch arguments. In that case, use settings.

Launch arguments

  • iOS — -key value pairs, e.g. Restart the app with launch arguments -AppleLanguages (de) -AppleLocale de_DE
  • Android — intent extras, e.g. Restart the app with launch arguments --es key value --ez flag true
Spur keeps any launch arguments set on the environment, and the values apply only to this test. On Android, an extra only has an effect if the app’s launch screen reads it.

App settings

  • iOS — e.g. Restart the app with settings -showOnboarding NO -language fr-FR
  • Android — e.g. Restart the app with settings -show_onboarding false -language fr-FR
-language sets the app’s own language on both platforms (Android 13 and later).
Use the setting names the app itself uses, which can differ between iOS and Android. On iOS they are listed in the app’s Settings.bundle; ask the app’s team for the Android keys.

Writing values

  • Put a value with spaces or ; in quotes, e.g. -greeting "Hello world".
  • Write a list in parentheses with no spaces, e.g. (de,en) (iOS).
  • For settings, Spur writes YES/NO (or true/false) as on/off values and (a,b) as a list. Spur writes anything else as text. On Android, an existing setting keeps its type.
Spur rejects shell characters such as |, $, and backticks. Parentheses and ; inside a launch argument are supported on iOS only. Restart with settings needs a rooted Android emulator (Spur’s emulators are) and works on simulators and emulators, not physical devices.

Example use cases

  • Cold-start / first-launch testing — verify onboarding or splash behavior
  • Recovering a stuck screen — relaunch to a known state mid-test
  • Opening system Settings — e.g. Restart app com.apple.Preferences (iOS) / Restart app com.android.settings (Android) to change a system setting
  • Region or language for one test — Restart the app with settings -language de-DE (plus the app’s region setting) instead of navigating Settings

Platform support

Works on both iOS and Android. Restart with settings works on iOS simulators and Android emulators.