Open & Run the iOS App in Xcode
Launch the iOS app that links your shared framework.
Open & Run the iOS App in Xcode is a free Kotlin Multiplatform Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Kotlin Multiplatform Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Now the iOS Side
Android worked, so let's light up iOS. The iOS app lives in its own folder and you build it with Xcode, not Android Studio. 🍎
Open the Xcode Project
Inside the iosApp folder you'll find a project or workspace file. Double-click it to open the iOS app in Xcode.
open iosApp/iosApp.xcodeprojWorkspace vs Project File
If your setup uses CocoaPods, always open the .xcworkspace file. The plain .xcodeproj will miss the pod dependencies.
Pick a Scheme and Simulator
At the top of Xcode, choose the iosApp scheme and a simulator like iPhone 15 from the device dropdown.
The Shared Framework Link
The iOS app does not consume Kotlin source directly. It links a precompiled framework that Gradle produces from your shared module.
A Build Phase Runs Gradle
A custom build phase in Xcode calls Gradle first. That step compiles the shared framework before Swift code is even touched.
./gradlew :shared:embedAndSignAppleFrameworkForXcodePress Run in Xcode
Click the Run triangle. Xcode triggers Gradle, builds the framework, compiles Swift, and boots the simulator with your app.
Call Shared Code from Swift
Your Swift screen imports the framework and calls the shared API by name. The same logic that ran on Android now runs on iOS.
import shared
let text = Greeting().greet()First Build Is the Slow One
The very first iOS build compiles the whole framework, so be patient. Later runs reuse cached output and feel much faster. ⏳
Read Errors in the Issue Navigator
When something fails, open the Issue Navigator. Gradle errors and Swift errors both surface here with a jump-to-line link.
Same Logic, Two Apps
Seeing your shared greeting in the iOS simulator closes the loop. One Kotlin codebase is now powering both native apps.
Quick Check
Let's confirm how iOS consumes your shared Kotlin.
Recap
You opened the iosApp in Xcode, picked a simulator, and pressed Run. A build phase ran Gradle to make the framework, then Swift called your shared code live. 🎉
Frequently asked questions
Is the “Open & Run the iOS App in Xcode” lesson free?
Yes — the full text of “Open & Run the iOS App in Xcode” is free to read here on the web, and the Kotlin Multiplatform Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Kotlin Multiplatform Academy course, upgrade to CoddyKit PRO.
What will I learn in “Open & Run the iOS App in Xcode”?
Launch the iOS app that links your shared framework. You practise Kotlin Multiplatform Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Kotlin Multiplatform Academy?
No prior experience is required. Kotlin Multiplatform Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Open & Run the iOS App in Xcode” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Kotlin Multiplatform Academy lesson?
Yes. Every Kotlin Multiplatform Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Run the Android App from Studio
- Open & Run the iOS App in Xcode
- How the iOS Framework Is Built
- Debug 'Shared Code Not Found' Issues