Building TrainerKit: What I Learned Developing a Native Mac App for Indoor Cycling
A solo developer's journey from idea to Mac App Store
When I started building TrainerKit, I had a simple goal: create a native Mac application that could control my smart trainer during structured indoor workouts. What I didn't expect was how much I'd learn about Swift, SwiftUI, Bluetooth protocols, and the modern Apple development ecosystem along the way.
The Problem I Was Solving
Like many cyclists, I found myself training indoors more frequently. While platforms like Zwift and TrainerRoad exist, I wanted something different—a focused tool for structured interval training without the subscription, something that felt truly native to the Mac and could support my whole family's training needs, each with very different fitness levels.
TrainerKit became my answer: a workout builder and smart trainer controller that prioritizes clarity, customization, and seamless integration with the fitness platforms I already use.
Technical Foundations
Building TrainerKit meant diving deep into several interconnected technologies:
Core Bluetooth for Smart Trainer Communication — Connecting to smart trainers like the Wahoo Kickr and Zwift Hub required implementing the FTMS (Fitness Machine Service) Bluetooth profile. This protocol handles everything from reading power and cadence data to sending resistance commands in real-time. Getting the bidirectional communication reliable across different trainer manufacturers was one of the more challenging aspects of the project.
SwiftUI for a Modern Interface — I chose SwiftUI from the start, which meant embracing its declarative approach to building interfaces. The result is an application that feels at home on macOS while remaining responsive during intense workout sessions where the display needs to update power metrics every second.
FIT File Support — For interoperability with the broader fitness ecosystem, I integrated Garmin's FIT SDK. This allows TrainerKit to export completed workouts in a format that virtually every fitness platform understands—essential for users who track their training across multiple services.
Multi-Athlete Architecture
One design decision I'm particularly proud of is the multi-athlete support system. In my household, my wife and I train at significantly different power levels. Rather than storing absolute power values in workouts, TrainerKit uses FTP-relative percentages. A "Sweet Spot" interval at 90% FTP calculates to 180 watts for one athlete and 225 watts for another—from the same workout file.
Each athlete profile maintains separate credentials for connected services like Strava and Intervals.icu, separate workout histories, and separate FTP test results. Switching between athletes is seamless, with the application remembering each person's preferences and connections.
Recommended by LinkedIn
Integrations That Matter
Modern training doesn't happen in isolation. TrainerKit integrates with:
Implementing these integrations taught me a lot about API design, token management, and the importance of graceful error handling when network operations fail mid-workout.
The App Store Journey
Submitting TrainerKit to the Mac App Store was an education in itself. Apple's review process pushed me to refine UI layouts, improve accessibility, and justify every entitlement the app requires. The Bluetooth permission alone required a detailed explanation of why a fitness app needs to connect to external devices.
Creating the demo video, writing the metadata, and preparing screenshots across different display sizes added to the timeline—but the result is a more polished product that I'm proud to have available publicly.
What's Next
TrainerKit is expanding beyond the Mac. The iOS companion app is in development, and an Apple Watch component will bring heart rate monitoring directly to the wrist during workouts. The challenge now is maintaining a shared codebase while adapting the experience to each platform's strengths. I actually have a working iOS and WatchOS version and developing new features like .gpx elevation graph riding with virtual shifting!
For any developers considering building fitness applications: the space is technically demanding but rewarding. There's something uniquely satisfying about software that directly enables physical training and helps people improve their health.
TrainerKit is available on the Mac App Store. I'm always interested in connecting with other developers working in the fitness technology space. I welcome feedback on TrainerKit and if there are any feature requests or issues check out the support page.
#SwiftUI #macOS #iOS #IndoorCycling #FitnessApp #AppDevelopment #IndieApp
https://apps.apple.com/us/app/trainerkit/id6757768724?mt=12 TrainerKit Support and feedback https://mdwhaley.github.io/