What do I need to do to port my workout app from watchOS to iOS?

Asked on 06/15/2025

1 search

To port your workout app from watchOS to iOS, you can leverage the HealthKit APIs available on iOS and iPadOS. Here are some steps and considerations based on the WWDC sessions:

  1. Use the Same Codebase: If you already have a workout app on Apple Watch, you can use the same code on iPhone and iPad with minimal changes. The workout session APIs are consistent across platforms, allowing you to track activities and save workouts in HealthKit.

  2. Workout Session Setup: Begin by creating a workout configuration that reflects the activity type (e.g., running) and location (e.g., outdoor). Then, create an HKWorkoutSession and attach a data source to collect health metrics during the workout.

  3. Handle Device Lock: Unlike the Apple Watch, the iPhone may lock during a workout. Health data is not available when the device is locked, but the system will prompt the user to allow workout data to be available even when locked. This is an opportunity to use live activities to display crucial metrics on the lock screen.

  4. Siri Intents and Live Activities: Implement Siri Intents to handle workout commands from the lock screen and use live activities to keep users updated with real-time metrics.

  5. Best Practices: Ensure your app only requests authorization for necessary data types to avoid confusing users. Use the Workout Builder API to create and save workouts, ensuring activity rings are updated correctly.

For more detailed guidance, you can refer to the session Track workouts with HealthKit on iOS and iPadOS (00:56) which covers running a workout session and best practices.