Ionic app test on android emulator


#1

Hi guys,
I need to test my app into android emulator because I’m using the particular features not testable into browser, like sqlite and camera.

I started my app into device but I’d like to enable this features:
a) the livereload of the app when I change the source
b) debug step by step

For debugging I can use the Chrome console opened by chrome://inspect/#devices and I can see the console.

I executed this command
ionic cordova run android --livereload

I tried apply this option --livereload but I don’t understand what is the IP and How ionic works.

When my Emulator start the app I have the connection error message

Could you please help me to found the best approach?

Thanks
Luca


#2

I don’t know if this is the only way to work with --livereload:

If you use ionic cordova run android --livereload with a computer in the wireless internet, you could choose the address to open the server in the mobile’s browser

after use the command in the node, you will notice a few links in the External, at my case is “http://192.168.0.12:8100”, when i acess this link with the mobile’s browser i can use livereload in my android

It’s all i can say to help you


#3

Hi @MuriloAndre, thanks for your reply. I don’t understand the steps. Could you please to help me write the procedure step by step?

Example:

  1. Open Android Emulator on my Notebook
  2. Execute command " ionic cordova run android --livereload "
  3. The script will ask me which ip I want to use but I don’t understand the reason.
  4. The app will be loaded into my emulator
  5. In the emulator I see the error message. Connection not found

Help me please
L


#4

ohhh
i replied because i thought that you want to add livereload in your mobile

i never used mobile emulator to run ionic app, but you could choose the ip in the third step and open the emulator, then use the browser emulator with the ip which you get in the prompt

I have another solution for you: You could install Atom, they have some package, like “Ionic: Preview” that is one preview for iphone and android experience to you while you code