# Deploy ionic capacitor App in real android device

**URL:** <https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530>\
**Category:** Capacitor\
**Created:** [December 13, 2022, 7:00pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530 "2022-12-13T19:00:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![manarmohammad](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@manarmohammad](https://forum.ionicframework.com/u/manarmohammad)\
**Post date:** [December 13, 2022, 7:00pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/1 "2022-12-13T19:00:09Z")

</div>

I have ionic capacitor App, i want to deploy it in my real android device in order to test some plugins like geolocation community plugin. however, i can’t accomblish my goal,when i write  
adb devices , i see my device id and is online but when i write the command  
ionic capacitor run android --target [deviceId]  
it give me an error says:  
capacitor.cmd open android  
[error] Unable to launch Android Studio. Is it installed?  
Attempted to open Android Studio at:  
You can configure this with the CAPACITOR\_ANDROID\_STUDIO\_PATH environment variable.  
the idea i don’t want to display through android studio.  
can you please help me

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [December 13, 2022, 7:05pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/2 "2022-12-13T19:05:10Z")

</div>

I believe it still needs to know what the Android Studio path is so it can use the build binaries shipped with Android Studio to build the apk and then run it on your device.

**EDIT**  
You might also need to set `ANDROID_SDK_ROOT`. This is what I have on Linux:

```auto
export CAPACITOR_ANDROID_STUDIO_PATH=/opt/android-studio/bin/studio.sh
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin # avdmanager, sdkmanager
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools # adb, logcat
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator # emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/build-tools # apksigner, zipalign

```

---

<div class="post-metadata">

**Author:** ![manarmohammad](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@manarmohammad](https://forum.ionicframework.com/u/manarmohammad)\
**Post date:** [December 13, 2022, 7:24pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/3 "2022-12-13T19:24:05Z")

</div>

thank you for your reply 🙂 , well i don’t have all the android studio environment installed. i just downloaded the sdk.  
Now i added the variables except the one to tools/bin i didn’t find it in my sdk folder ☹

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [December 13, 2022, 8:14pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/4 "2022-12-13T20:14:53Z")

</div>

Looks like you are using an old Ionic CLI version since newer Ionic CLI versions won’t open Android Studio, but will run the app directly in your device.

Make sure you get 6.20.5 when you run `ionic version`

---

<div class="post-metadata">

**Author:** ![manarmohammad](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@manarmohammad](https://forum.ionicframework.com/u/manarmohammad)\
**Post date:** [December 14, 2022, 1:21pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/6 "2022-12-14T13:21:43Z")

</div>

thank you it seems to be worked but now thiss error appears :  
Running Gradle build - failed!  
[capacitor] [error] Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details  
[capacitor]  
[capacitor] FAILURE: Build failed with an exception.  
[capacitor]  
[capacitor] \* What went wrong:  
[capacitor] Could not open settings generic class cache for settings file

---

<div class="post-metadata">

**Author:** ![mikrochipkid](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mikrochipkid/32/116956_2.png) [@mikrochipkid](https://forum.ionicframework.com/u/mikrochipkid)\
**Post date:** [December 14, 2022, 2:47pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/7 "2022-12-14T14:47:54Z")

</div>

Just download Android studio and open the app there so it can configure… You could avoid all these issues…

---

<div class="post-metadata">

**Author:** ![manarmohammad](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@manarmohammad](https://forum.ionicframework.com/u/manarmohammad)\
**Post date:** [December 14, 2022, 2:59pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/8 "2022-12-14T14:59:54Z")

</div>

i tried once but it is so difficult to make all the configurations of android environment and it didn’t work at all … couldn’t make any emulator run

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [December 14, 2022, 3:57pm UTC](https://forum.ionicframework.com/t/deploy-ionic-capacitor-app-in-real-android-device/229530/9 "2022-12-14T15:57:18Z")

</div>

From my understanding, running it via the Ionic CLI is the exact same thing. The CLI is using the same underlying SDK/binaries as Android Studio. If it doesn’t work via Android Studio, it’s not going to work via the Ionic CLI.
