ionic serve starts on localhost and not the server IP

后端 未结 2 1347
温柔的废话
温柔的废话 2021-02-15 15:00

When running ionic serve I see this:

  Gulp startup tasks: [ \'sass\', \'watch\' ]
  Running dev server: http://localhost:8100
  Running live reload server: http         


        
2条回答
  •  时光说笑
    2021-02-15 15:45

    NEW ANSWER:

    For the newer version of ionic this has been changed to --address

    • ionic address command give the option to select your IP address. And you can select one from.

    • You can explicitely define IP address and port like this:

      ionic serve --address address --port port //8100 is default

      example 1: ionic serve --address localhost --port 8101

      example 2: ionic serve --address localhost --port 8101

    • try --lab option to see multiple platforms at once.

      ionic serve --address localhost --lab

    Clikc to Learn more options

    OLd Answer:

    Use -address localhost

    run

    ionic serve -address localhost
    

    to test your apps on multiple screen sizes and platform types use with --lab

    ionic serve --lab -address localhost
    

提交回复
热议问题