How do I run an ionic app in android studio emulator?
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
-
First open Android studio and start an emulator wait when its still done (first time needs more time)
test if the emulator is available with `android list devices``
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
Related videos on Youtube
manasa sidhardhan
Updated on March 05, 2021Comments
-
manasa sidhardhan about 3 years
I am new to ionic and I want to run my app on android studio emulator. I did refer the link https://developer.android.com/studio/run/index.html. But I do not seem to understand how to run my ionic app on emulator
-
Suraj Rao about 7 years
-
-
Kim T over 5 yearsl = livereload, c = console logs, s = ?, ionicframework.com/docs/cli/cordova/emulate
-
akmozo about 4 years@KimT
s = server logs
.. take a look : github.com/isathish/…