Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator does not install app when using 'ionic emulate android' command

I am new to Ionic and Android programming, so I am sorry if there are any inconveniences.

My problem is that I can't see my app (default app in tutorial) on the emulated android virtual device. It just shows a stock android phone basically after I run ionic emulate android. So I assume the app wasn't installed on the emulator.

It builds the apk but doesn't do anything with it it seems. I think I installed everythink correctly:

> duc@duc-ThinkPad-T450s:~/myApp$ ionic info Your system information:
> Cordova CLI: 6.0.0 Ionic Version: 1.2.4 Ionic CLI Version: 1.7.14
> Ionic App Lib Version: 0.7.0 OS: Distributor ID: Ubuntu Description:
> Ubuntu 14.04.4 LTS Node Version: v4.4.1

I hope you could help me out, just wanted to get the tutorial going :)

Greets, Duc

Edit:

I finally managed to install the apk manually to the emulated device using this command:

 adb -s <your emulator> install </your/apk/path>

However installing it manually is very inconvenient and annoying. Anyone has a solution for this?

like image 984
D. Phi Avatar asked Mar 30 '16 18:03

D. Phi


2 Answers

Problem solved! You have to write in the commandline:

android avd

Then a menu pops up and you have to create your own avd, then start it

Then you need to open a new terminal (ctrl+alt+t). Cd to the right path of your app.

Now ionic emulate android should work.

like image 166
D. Phi Avatar answered Sep 30 '22 18:09

D. Phi


You can also use third-party emulator like Genymotion (which works much faster).

Use ionic build android and just drag build APK /platforms/android/build/outputs/apk/android-debug.apk to Genymotion emulator.

enter image description here

like image 23
Mikhail Avatar answered Sep 30 '22 18:09

Mikhail