How do I run an ionic app in android studio emulator?

63,740

Solution 1

First ensure that your Android Studio setup is correctly done. If want to do that from scratch refer these links - link1 and link2. In link2, you can choose your OS as well.

This ionic guide will help you setup ionic project correctly. If you follow this guide entirely, you will see the use of emulate, platform, run, serve, etc commands of ionic.

Basically what you need to do is first add an android platform to your project:

ionic cordova platform add android

And then emulate your project using:

ionic cordova emulate android

Solution 2

  1. First open Android studio and start an emulator wait when its still done (first time needs more time)

    1. test if the emulator is available with `android list devices``

    2. ionic cordova emulate android will publish it on your emulator

Solution 3

You can install capacitor which created by the ionic team and i recommend it over cordova

Inside your project do this

ionic integrations enable capacitor

then

npx cap init [appName] [appId]

after that add android or ios folder to your project by this command

npx cap add ios
npx cap add android

then finaly you can run your app by

npx cap open ios
npx cap open android

or this command

ionic capacitor run android 

Solution 4

In the latest Android Studio you need to make at least one project and open the project, and then create AVD (android virtual device) in Tools - Android - AVD Manager, and then in your ionic project

ionic cordova emulate [platform]

Solution 5

You can use this for example :

ionic cordova emulate android -lcs
Share:
63,740

Related videos on Youtube

manasa sidhardhan
Author by

manasa sidhardhan

Updated on March 05, 2021

Comments