From fcd4a8db17b2d3e8a355e9f4299dcce03304743d Mon Sep 17 00:00:00 2001 From: Sanjeed <40694326+sanjeed5@users.noreply.github.com> Date: Sun, 11 Apr 2021 23:36:51 +0400 Subject: [PATCH 1/3] Update android.md 1. Add `ionic build` step before `ionic capacitor add android`. Beginners would get an error of not being able to find web assets directory. 2. `npx cap open android` is shown in the output after `ionic capacitor add android`, but we could add it so that it's clear for the reader. --- src/pages/developing/android.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/developing/android.md b/src/pages/developing/android.md index cb259dd10b4..6241e814d64 100755 --- a/src/pages/developing/android.md +++ b/src/pages/developing/android.md @@ -111,7 +111,7 @@ Native Android apps are compiled with the `. See [the Cordova documentation](https://cordova.apache.org/docs/en/latest/config_ref/#widget) for more information. - + + You can open the Android Studio Project using: + + ```shell + $ npx cap open android + ``` ## Running with Capacitor -Capacitor uses Android Studio to build and run apps to simulators and devices. +Capacitor uses Android Studio to build and run apps to simulators and devices. 1. **Develop the Ionic app and sync it to the native project.** From fa69ec8983174dc7d9c48c5bcf07f819a74c5c19 Mon Sep 17 00:00:00 2001 From: Shawn Taylor Date: Tue, 6 Jun 2023 14:13:00 -0400 Subject: [PATCH 2/3] Clarify steps --- docs/developing/android.md | 16 ++++++++++++++-- versioned_docs/version-v5/developing/android.md | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/developing/android.md b/docs/developing/android.md index 825e76de6df..bde2fae0835 100644 --- a/docs/developing/android.md +++ b/docs/developing/android.md @@ -125,7 +125,13 @@ If you are using any version of **`cordova-android`** below `10.0.0`, install th Before apps can be deployed to Android simulators and devices, the native project must be configured. -1. **Generate the native project, if it does not already exist.** +1. **Perform an Ionic build, if you haven't already.** + + ``` + $ ionic build + ``` + +2. **Generate the native project, if it does not already exist.** For Capacitor, run the following: @@ -139,7 +145,7 @@ Before apps can be deployed to Android simulators and devices, the native projec $ ionic cordova prepare android ``` -2. **Set the [Package ID](../reference/glossary.md#package-id).** +3. **Set the [Package ID](../reference/glossary.md#package-id).** For Capacitor, open the `capacitor.config.json` file and modify the `appId` property. @@ -159,6 +165,12 @@ Capacitor uses Android Studio to build and run apps to simulators and devices. 2. **In Android Studio, click the Run button and then select the target simulator or device.** +You can open the Android Studio Project using: + + ```shell + $ ionic capacitor open android + ``` + ![Android Studio Run Button Area](/img/running/android-studio-run-button-area.png) ### Live reload diff --git a/versioned_docs/version-v5/developing/android.md b/versioned_docs/version-v5/developing/android.md index 1011bf6a366..3b060bd0284 100644 --- a/versioned_docs/version-v5/developing/android.md +++ b/versioned_docs/version-v5/developing/android.md @@ -123,7 +123,7 @@ If you are using any version of **`cordova-android`** below `10.0.0`, install th ## Project Setup -Before apps can be deployed to Android simulators and devices, the native project must be configured. You also need to run `ionic build` if you haven't already. +Before apps can be deployed to Android simulators and devices, the native project must be configured. 1. **Generate the native project, if it does not already exist.** From 6c3845dc300b24b6ef570ef89ee64e5a24870bb9 Mon Sep 17 00:00:00 2001 From: Shawn Taylor Date: Tue, 6 Jun 2023 14:24:22 -0400 Subject: [PATCH 3/3] Fix formatting and improve copy --- docs/developing/android.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/developing/android.md b/docs/developing/android.md index bde2fae0835..d734f985a52 100644 --- a/docs/developing/android.md +++ b/docs/developing/android.md @@ -163,15 +163,17 @@ Capacitor uses Android Studio to build and run apps to simulators and devices. $ ionic capacitor copy android ``` -2. **In Android Studio, click the Run button and then select the target simulator or device.** +2. **Run the app on a simulator or device.** -You can open the Android Studio Project using: + You can open the Android Studio Project using: - ```shell - $ ionic capacitor open android - ``` + ```shell + $ ionic capacitor open android + ``` + + In Android Studio, click the Run button and then select the target simulator or device. -![Android Studio Run Button Area](/img/running/android-studio-run-button-area.png) + ![Android Studio Run Button Area](/img/running/android-studio-run-button-area.png) ### Live reload