Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Kotlin Mobile: Android & iOS App GeneratorNew to Visual Studio Code? Get it now.
Kotlin Mobile: Android & iOS App Generator

Kotlin Mobile: Android & iOS App Generator

Lord Programmer

|
1 install
| (0) | Free
Create Kotlin apps for Android, or Android + iOS with Compose Multiplatform, and build signed Debug/Release APKs and iOS apps from VS Code, without opening Android Studio or Xcode.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Kotlin Mobile: Android & iOS App Generator

Create a Kotlin app for Android, or for Android + iOS with Compose Multiplatform, and build Debug or Release versions for each platform from VS Code, without opening Android Studio or Xcode.

The extension drives the official tooling: the Android SDK, the Gradle wrapper, the Android Gradle Plugin, keytool, and on macOS xcodebuild. Generated projects are ordinary projects. They also open in Android Studio, and the iOS part opens in Xcode.

Commands

Command What it does
Kotlin Mobile: Create New Application Wizard: name → platforms → package (and iOS bundle ID) → location → Compile / Minimum / Target SDK.
Kotlin Mobile: Android Build Debug Runs gradlew <app>:assembleDebug, streams output, and locates the APK.
Kotlin Mobile: Android Build Release Runs gradlew <app>:assembleRelease with your keystore, and locates the APK.
Kotlin Mobile: iOS Build Debug Builds the iOS app for the iOS Simulator (no signing needed) and locates the .app. macOS only.
Kotlin Mobile: iOS Build Release Archives for devices and exports a signed .ipa. macOS only.
Kotlin Mobile: Configure Release Signing (Android) Selects an existing keystore or creates one. Passwords go to VS Code Secret Storage.
Kotlin Mobile: Configure Release Signing (iOS) Sets the Apple team, automatic or manual signing, and the distribution method.

Build output appears in the Kotlin Mobile output channel. After a successful build, use Open Output Folder to reveal the APK, .app or .ipa in your file manager.

Prerequisites

For all projects

  1. Android SDK with at least one SDK Platform of API 36 or newer, plus accepted licenses:
    sdkmanager "platforms;android-36" "build-tools;36.0.0" "platform-tools"
    sdkmanager --licenses
    
    Android Studio installs these too, but it isn't required.
  2. JDK 17 or newer, a full JDK that includes javac. A Java runtime (JRE) is not enough. On Fedora/RHEL install java-21-openjdk-devel; on Debian/Ubuntu install openjdk-21-jdk. The JDK bundled with Android Studio is detected automatically.
  3. Internet access on the first build, so Gradle can download itself and the dependencies.

Additionally, for iOS builds

  1. macOS with Xcode (the full Xcode, not only the Command Line Tools), opened once to finish its setup. Select it with sudo xcode-select -s /Applications/Xcode.app.
  2. The iOS platform installed in Xcode (Xcode → Settings → Components).
  3. For release builds, an Apple Developer account. With automatic signing, add it in Xcode → Settings → Accounts.

You can create an Android + iOS project and build its Android app on Linux or Windows. The iOS commands explain that they need a Mac.

How tools are found

Tool Search order
Android SDK androidKotlin.sdkPath setting → ANDROID_HOME → ANDROID_SDK_ROOT → OS default (~/Android/Sdk, ~/Library/Android/sdk, %LOCALAPPDATA%\Android\Sdk)
JDK androidKotlin.javaHome setting → JAVA_HOME → Android Studio's bundled JBR → java on PATH (resolved to its JDK) → system JDK folders
Xcode The Xcode selected with xcode-select

If a path is set explicitly in the settings and is invalid, the extension reports it as an error instead of silently using a different SDK or JDK.

Settings

Setting Description
androidKotlin.sdkPath Absolute path to the Android SDK.
androidKotlin.javaHome Absolute path to a JDK 17+ (also used by the iOS build's Kotlin step).

Both settings are machine-scoped. A workspace's .vscode/settings.json can't override them, so an opened repository can't redirect the build to a different JDK or SDK.

Creating an application

The wizard asks for:

  • Application name: the label under the launcher icon. It must start with a letter and may contain letters, digits, spaces, - and _.
  • Platforms:
    • Android: a standard Android project with one app module (Kotlin + Jetpack Compose).
    • Android + iOS: a Compose Multiplatform project. The UI is written once in Kotlin and shared by both apps.
  • Package name: the Android application ID, for example com.example.myapp. It needs at least two segments. Each segment starts with a letter, contains only [A-Za-z0-9_], and isn't a Kotlin/Java keyword.
  • iOS bundle identifier (Android + iOS only): letters, digits, - and .. _ isn't allowed on iOS, so it's suggested from the package name with _ replaced by -.
  • Location: a writable parent folder. The project goes into <location>/<AppName>. Existing folders are never overwritten, not even empty ones.
  • Compile SDK: the Android API your code is compiled against. Only installed, stable platforms are offered.
  • Minimum SDK: the oldest Android version that can install the app (API 23 or higher).
  • Target SDK: the Android version the app is designed for. It must be between Minimum SDK and Compile SDK.

The rule minSdk ≤ targetSdk ≤ compileSdk is enforced, and so is a platform-must-be-installed check. Library versions are picked to match the Compile SDK.

Android-only projects:

Compile SDK Compose BOM core-ktx activity-compose lifecycle
37+ 2026.09.00 1.19.1 1.13.0 2.11.0
36 2026.06.01 1.18.0 1.12.4 2.10.0

Android + iOS projects: Compose Multiplatform 1.11.1 with Material 3 1.11.0-alpha07. This is the pairing JetBrains uses in its own KMP template. activity-compose is 1.13.0 for API 37+ and 1.12.4 for API 36. The iOS deployment target is iOS 15.3.

Toolchain: Gradle 9.8.2 (the download is verified by SHA-256), Android Gradle Plugin 9.5.0, and Kotlin 2.4.21.

Generated layout: Android

MyApplication/
├── app/
│   ├── build.gradle.kts
│   └── src/main/
│       ├── AndroidManifest.xml
│       ├── java/com/example/myapplication/{MainActivity.kt, ui/theme/…}
│       └── res/ (strings, themes, adaptive launcher icon)
├── gradle/{libs.versions.toml, wrapper/…}
├── build.gradle.kts, settings.gradle.kts, gradle.properties
├── local.properties   (sdk.dir, git-ignored)
├── Makefile
└── gradlew, gradlew.bat

Generated layout: Android + iOS

MyApp/
├── shared/                         Kotlin Multiplatform library: the shared Compose UI
│   └── src/
│       ├── commonMain/kotlin/…/App.kt, Platform.kt
│       ├── androidMain/kotlin/…/Platform.android.kt
│       └── iosMain/kotlin/…/MainViewController.kt, Platform.ios.kt
├── androidApp/                     Android application that shows App()
│   ├── build.gradle.kts
│   └── src/main/{AndroidManifest.xml, kotlin/…/MainActivity.kt, res/}
├── iosApp/                         Xcode project that embeds the Shared framework
│   ├── Configuration/Config.xcconfig   (BUNDLE_ID, APP_NAME; TEAM_ID left empty)
│   ├── iosApp/{iOSApp.swift, ContentView.swift, Info.plist, Assets.xcassets}
│   └── iosApp.xcodeproj            (with a shared "iosApp" scheme)
├── gradle/, build.gradle.kts, settings.gradle.kts, gradle.properties
├── Makefile
└── gradlew, gradlew.bat

The Xcode project has a Compile Kotlin Framework build phase. It runs ./gradlew :shared:embedAndSignAppleFrameworkForXcode, so building in Xcode (or with xcodebuild) compiles the Kotlin code automatically.

Building from a terminal

The generated Makefile works on Linux and macOS. If JAVA_HOME isn't set, it falls back to Android Studio's bundled JDK:

make debug         # JAVA_HOME=${JAVA_HOME:-$HOME/android-studio/android-studio/jbr} ./gradlew assembleDebug
make release       # same, with assembleRelease
make clean
make ios-debug     # Android + iOS projects, macOS: simulator build, no signing
make ios-release   # Android + iOS projects, macOS: xcodebuild archive

For a signed make release, set the ANDROID_RELEASE_* variables described in Android release signing first. Without them the release APK is unsigned.

Building

Open the project's root folder (the one containing settings.gradle.kts) and run a build command. Builds run one at a time and can be cancelled from the progress notification. Build commands are disabled in untrusted workspaces, because Gradle and Xcode build phases execute the project's code.

Android

Before running Gradle, the extension checks that:

  • settings.gradle.kts includes an application module (app or androidApp);
  • the Gradle wrapper is complete and downloads Gradle over HTTPS;
  • a suitable JDK and the Android SDK are available.

It runs ./gradlew on Linux and macOS (or sh gradlew if the script lost its executable bit) and gradlew.bat on Windows. APK file names are never assumed. The extension scans <module>/build/outputs/apk/<buildType>/ and reads AGP's output-metadata.json.

iOS (macOS)

Build xcodebuild Output
iOS Build Debug build, -sdk iphonesimulator, CODE_SIGNING_ALLOWED=NO iosApp/build/DerivedData/Build/Products/Debug-iphonesimulator/<App>.app
iOS Build Release archive for generic/platform=iOS, then -exportArchive iosApp/build/export/<App>.ipa

The debug build runs in the iOS Simulator. It can't be installed on a physical device, because that requires signing. The extension passes JAVA_HOME (and ANDROID_HOME) to xcodebuild, so the Kotlin build phase finds the JDK.

Android release signing

Run Kotlin Mobile: Configure Release Signing (Android) and choose one of these options:

  • Use an existing keystore: pick the .jks, .keystore or .p12 file, then enter the key alias, keystore password and key password.
  • Create a new keystore: generates a PKCS12 keystore with an RSA 2048 key valid for about 27 years. Save it outside the project and back it up: if you lose the keystore or its password, you can't publish updates.

The credentials are checked with keytool before they're saved. A wrong keystore password, wrong key password or a missing alias each gets its own error.

Data Stored in
Keystore and key passwords VS Code Secret Storage (OS keychain), never in settings or files
Keystore path and key alias The extension's private global state (outside the project)
The project Nothing: no paths, aliases or passwords

At build time the values reach Gradle only as environment variables of the Gradle process. They are never passed as command-line arguments, which other users on the machine could see in process listings. Passwords are also masked in the output channel. Generated projects read:

ANDROID_RELEASE_STORE_FILE, ANDROID_RELEASE_STORE_PASSWORD,
ANDROID_RELEASE_KEY_ALIAS, ANDROID_RELEASE_KEY_PASSWORD

CI systems can set the same variables. Projects not generated by this extension are signed through the Android Gradle Plugin's standard android.injected.signing.* properties, which are also passed through the environment.

If signing isn't configured, Android Build Release asks whether to configure it or to build an unsigned APK on purpose. An unsigned result (*-release-unsigned.apk) is clearly reported as unsigned.

iOS release signing

Run Kotlin Mobile: Configure Release Signing (iOS) and choose one of these options:

  • Automatic signing (recommended): enter or pick your Team ID. Xcode creates and manages the certificates and provisioning profiles (-allowProvisioningUpdates). Your Apple account must be added in Xcode → Settings → Accounts.
  • Manual signing: pick a signing certificate from your Keychain and an installed provisioning profile that matches the team and bundle ID. On macOS the extension lists the certificates (security find-identity) and the unexpired profiles, and checks that the certificate is installed.

Then choose how the .ipa will be distributed:

  • App Store Connect: TestFlight or the App Store.
  • Release Testing: Ad Hoc, for registered devices.
  • Enterprise: in-house distribution.
  • Debugging: Development, for registered development devices.

iOS signing involves no passwords: certificates and private keys stay in the macOS Keychain. The team, style and profile names are stored in the extension's global state, not in the project. Config.xcconfig keeps TEAM_ID empty. At build time the settings are passed to xcodebuild as build-setting overrides, and iosApp/build/ExportOptions.plist (git-ignored) is written for the export step.

If signing isn't configured, iOS Build Release asks whether to configure it or to produce an unsigned .xcarchive. That archive is clearly reported as unsigned, and no .ipa is exported.

Troubleshooting

Problem Fix
Android SDK not found Set ANDROID_HOME or androidKotlin.sdkPath.
No compatible Android SDK Platform is installed sdkmanager "platforms;android-36" (or newer).
Only a Java runtime (JRE) was found Install a full JDK 17+ and/or set androidKotlin.javaHome.
licenses have not been accepted sdkmanager --licenses
Gradle wrapper is missing Restore the wrapper files, or run gradle wrapper in the project.
signing credentials were rejected Re-run Configure Release Signing (Android).
A dependency requires a newer Compile SDK Raise compileSdk and install that platform.
iOS apps can only be built on macOS Open the project on a Mac; the Android app can still be built anywhere.
Xcode was not found Install Xcode, then sudo xcode-select -s /Applications/Xcode.app.
No iOS Xcode project was found The project was created as Android only. Create an Android + iOS project.
No Account for Team Add your Apple account in Xcode → Settings → Accounts.
The Kotlin framework build (Gradle) failed See the Gradle errors in the output; check the JDK settings.
The iOS platform is not installed Xcode → Settings → Components, or xcodebuild -downloadPlatform iOS.

Full Gradle and xcodebuild output is always available in View → Output → Kotlin Mobile.

Development

npm install
npm run compile   # build to out/
npm test          # unit tests (node:test); no Android tooling, Xcode or macOS needed
npm run package   # create a .vsix (requires @vscode/vsce)

Press F5 in VS Code to launch an Extension Development Host.

Architecture

src/
├── extension.ts              activation, command registration
├── commands/                 VS Code UI only (wizards, notifications, progress)
│   ├── common.ts             error handling, project picking, build lock, storage adapters
│   ├── createProject.ts
│   ├── buildApk.ts           Android Debug and Release builds
│   ├── buildIos.ts           iOS Debug (simulator) and Release (archive + export) builds
│   ├── configureSigning.ts   Android keystore signing
│   └── configureIosSigning.ts
├── android/                  SDK / JDK detection and API-level rules
├── ios/                      Xcode detection, Xcode project discovery, xcodebuild arguments, iOS signing
├── project/                  input validation, templates (Android, Compose Multiplatform, iOS), generation
├── build/                    Gradle invocation, APK location, Android signing and keytool
├── services/                 process execution (no shell), redacting logger
└── core/                     shared error type and signing environment names

Everything outside commands/ and extension.ts is independent of the VS Code API. External tools (Gradle, keytool, xcodebuild, security) are accessed through the ProcessRunner interface, so tests can mock them. The iOS Xcode project layout is adapted from JetBrains' KMP-App-Template (Apache License 2.0).

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft