Run Ionic/Cordova app on Device/Emulator


#1

Hello everyone,

I’m new Ionic Framework user and I really need your help.

I’m trying to install by myself the apk without running the server through terminal but login page appears (not completely) and the application does not launch ! (I’m trying to test the application before sending it to the client. He will take generated apk and will install it on his device).

Here is a screenshot :

Any ideas ?

Thanks.


#2

May be your application have an error.
Try to debug your application on emulator or real devices before export to apk
You can use MEmu player or Genymotion to debug. But I prefer MEmu.
When MEmu lauched, i run this command from my woking ionic folder (save it as runMEmu.cmd file to your working project).

cmd /k ionic cordova run android --target 127.0.0.1:21503 --livereload --prop
  • cmd /k : to keep cmd window after run finished
  • ionic cordova run android : is ionic CLI command, that run your application on emulator or real devices.
  • –target 127.0.0.1:21503 : mean the devices you want to run this application is MEmu player
  • –livereload --prop : is livereload the project when you change files in your folder. --prop mean i dont know

Then you open chrome and type the address: chrome://inspect/ you will see MEmu and view the console of your application.


#3

Hello drquochoai,

Thank you very much for your help.

I will give it a try but I don’t think that the application has an error cause it works fine when I run it using terminal and the command : ionic run android

I will keep you in touch.

Thanks again.


#4

Thanks @drquochoai,

Using Chrome Inspector I fixed the issue but with Genymotion. While trying to use Memu Player, I got this error (while it’s working fine on Genymotion).

ionic_forum2


#5

try this command to fixed
"deviceready has not fired after 5 seconds"

make sure your all plugin use code are under
platform.ready().then(() => {}

c:\demoapp> ionic cordova run android --prod