Kotlin Multiplatform Academy · レッスン

StudioからAndroidアプリを実行する

Androidターゲットをビルドし、エミュレーターにデプロイします

レッスン 1/413 ステップ

「StudioからAndroidアプリを実行する」はCoddyKit上の無料Kotlin Multiplatform Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはKotlin Multiplatform Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Android First, On Purpose

Your shared Kotlin is ready, so let's see it live. We start with Android because Android Studio drives the whole build, end to end. 🚀

Pick the androidApp Module

The run configuration you want is the one for the androidApp module. It bundles your shared code into a real installable app.

Choose a Device or Emulator

Next to the run button is the device picker. Select a connected phone or spin up an emulator image from the dropdown.

Create an Emulator Fast

No device handy? Open the Device Manager and create a virtual device. A recent Pixel with a modern API level is a safe default.

Press the Green Run Button

Hit the green Run arrow. Studio compiles the shared module, builds the APK, installs it, and launches the app for you.

Gradle Does the Heavy Lifting

Behind the scenes Gradle assembles the androidApp and pulls in your shared library as a normal dependency. Watch the Build tab for progress.

./gradlew :androidApp:installDebug

Shared Code Is Just a Library

On Android there is no special bridge. Your shared module compiles to JVM bytecode and is consumed like any other Kotlin dependency.

implementation(project(":shared"))

Watch the Logcat Window

Open Logcat to see runtime logs from both your app and shared code. It is your first stop when something behaves oddly.

Edit, Rerun, Repeat

Change shared logic, hit Run again, and Studio rebuilds only what changed. This tight loop keeps your feedback fast. ⚡

Build Failed? Read the Top Line

If the build stops, scroll to the first error in the Build tab. The earliest message usually points at the real cause.

You Just Shipped to a Device

Seeing your shared greeting on a real Android screen proves the wiring works. That confidence carries straight into the iOS run next.

Quick Check

Let's confirm how the Android build consumes your shared code.

Recap

You ran the app by picking androidApp, choosing a device, and pressing Run. Gradle built the shared module as a plain dependency and Logcat showed it working. 🎉

無料で開始

AI チューターと学ぶ Kotlin — 無料

ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。

コース
30
レッスン
120

よくある質問

「StudioからAndroidアプリを実行する」レッスンは無料ですか?

はい。「StudioからAndroidアプリを実行する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Kotlin Multiplatform Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。

「StudioからAndroidアプリを実行する」で何を学びますか?

Androidターゲットをビルドし、エミュレーターにデプロイします ブラウザで直接実行するハンズオンコードでKotlin Multiplatform Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Kotlin Multiplatform Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのKotlin Multiplatform Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。

「StudioからAndroidアプリを実行する」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このKotlin Multiplatform Academyレッスンでコードを書いて実行できますか?

はい。すべてのKotlin Multiplatform Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. StudioからAndroidアプリを実行する
  2. XcodeでiOSアプリを開いて実行する
  3. iOS Frameworkのビルド方法
  4. 「共有コードが見つからない」問題をデバッグする
← Kotlin Multiplatform Academyに戻る