Search code examples
cordovaionic-frameworkionic3phonegap

Ionic 3 serve like Phonegap app


I want to develop Ionic 3 hybrid mobile application, but i am confused about one part, is there functionality similar to Phonegap functionality, Phonegap have possibility to serve application over his IP address, so , if i have installed Phonegap app on mobile, i can enter IP adress and port on what address is served Phonegap app and i can see how application looks like and how application works. Does Ionic 3 have this functionality? I can see that in Ionic i can see in browser over localhost:port, but i need to see on physical device, to enter IP address and port to see how application works. Thanks


Solution

  • Yes. You have two ways to do it:

    1. Using ionic serve:

    First your run ionic serve in your command line. Then when the local server start you will see the address for external server in command port (You need to search in command port to see it). It looks like:

    [OK] Development server running!
         Local: http://localhost:8100
         External: http://192.168.*.*:8100, http://192.168.*.*:8100
    

    Just enter the external address in your mobile browser and your app will run in it with livereload feature.
    Pros: Fast livereload
    Cons: Can not use native function. Some UI may differnt from your actual app

    2. Using ionic cordova run android -l

    Connect your device with your computer then run the command above. Make sure they ar using same wifi. That is all you need.
    Pros: Can use native function. It is actual your app when you build in device
    Cons: Slow livereload

    3. Using Ionic Dev App

    Download Ionic Dev App and follow instruction in the link.
    Pros: Can use native function. It is actual your app when you build in device. Fast livereload. Others can see your app if in same network
    Cons: Did not found :-)