How do I convert my watchOS workout app to run on iOS?

Asked on 06/15/2025

1 search

To convert your watchOS workout app to run on iOS, you can leverage the HealthKit APIs, which allow you to use the same code with minimal changes. Here's a brief overview of the process:

  1. Workout Session Setup: You can use a workout session to track activities on iOS just like on Apple Watch. Start by creating a workout configuration and setting its type (e.g., running) and location (e.g., outdoor).

  2. Workout Session Management: Create an HKWorkoutSession with the configuration, get the associated builder, and attach a data source. Prepare the session and start it with a countdown.

  3. Collecting Metrics: While the workout is running, you can collect health metrics. Note that iOS devices may not have all the sensors available on Apple Watch, such as heart rate sensors, but you can pair them with external devices that support the heart rate GATT profile.

  4. Handling Device Lock: Unlike Apple Watch, iOS devices may lock during a workout. Health data is not normally available when the device is locked, but a prompt will allow workout data to be available even when locked. You can use this opportunity to show live activity updates on the lock screen.

  5. Crash Recovery: Implement a scene delegate to handle crash recovery by retrieving the workout session from the Health Store and continuing the active workout.

For more detailed guidance, you can refer to the session Track workouts with HealthKit on iOS and iPadOS (00:00:56) from WWDC 2025, which covers running a workout session and other relevant topics.