Adding a new target to your KMP project: hello watchOS

Carlos Mota
5 min readApr 10, 2022
Adding a new target to your KMP project: hello watchOS

I’ve recently added support for watchOS on a project that already shares its business logic through Android, iOS, and Desktop. As always, this is possible through the wonders of Kotlin Multiplatform.

Depending on the code that you intend of sharing, the update that you need to do can be more or less direct.

Introduction

Before diving into the solution, it’s important to mention that depending on which watchOS version your app is going to target, you might need to add one or more platforms. According to JetBrains, you can currently release to:

  • watchosArm32, watchOS on ARM (ARM32) platforms (Apple Watch Series 3 and earlier)
  • watchosArm64, watchOS on ARM64_32 platforms (Apple Watch Series 4 and newer)
  • watchosX86, watchOS 32-bit simulator (watchOS 6.3 and earlier) on x86_64 platforms
  • watchosX64, watchOS 64-bit simulator (watchOS 7.0 and newer) on x86_64 platforms
  • watchosSimulatorArm64, watchOS simulator on Apple Silicon platforms (Mac M1)

Even if your app only targets watchOS 7.0+, Apple seems to require a framework for the previous versions. This is why in this article you’re going to use watchosArm32 and watchosArm64. These versions map into…

--

--

Carlos Mota

👨‍💻, 🔭🌖, 🗺, 📸, 🏃‍💨, 🇵🇹, 🖖 - is this how I should use emojis? Also: https://www.cafonsomota.xyz/