Contents

Background execution

Manage background sessions and tasks.

Overview

Apps on watchOS primarily run in the foreground to limit the impact on system resources. However, sometimes an app needs to perform an action when it’s not the foreground app. For a limited number of cases, watchOS provides options for running in the background.

Handle background notifications

When the system launches your app in the background, you can:

Schedule and handle background refresh tasks

A watchOS app uses a background refresh task to perform work in the background. If your app requires background operations, use one of the following techniques to respond to the task:

In both cases, the system launches your app and gives it a few seconds of background execution time to perform the task. Complete the background task as quickly as possible. For more information, see Using background tasks.

Start background sessions

Apps that support workouts, audio playback, or location updates can continue to run in the background until the current session ends. Your app must enable the appropriate background mode in your project’s capabilities, and then start the session while your app is running in the foreground.

Set up extended runtime sessions

Extended runtime sessions give your app additional time to run while the session is active. Extended runtime sessions provide support for the following session types:

  • Self care

  • Mindfulness

  • Physical therapy

  • Smart alarm

Extended runtime sessions let the app continue to communicate with a Bluetooth device, process data, or play sounds or haptics, even after the watch’s screen turns off. While most extended runtime sessions run your app as the frontmost app, some sessions run your app in the background. Select a session type based on the app’s intended use — not based on the features that the session provides.

For more information, see Using extended runtime sessions.

Topics

Background tasks

Background sessions

See Also

Runtime management