本文介绍了ionic serve 显示多个地址,我选错了一个...如何更改 ionic serve 使用的地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 ionic serve 并得到了以下响应,我没有三思而后选择 localhost.但是现在我想使用选项 1.Ionic 记住了我的选择,这样 ionic serve 永远不允许我再选择并使用 localhost...

I used ionic serve and got the below response to which I did not think twice and selected localhost. However now I want to use option 1. Ionic has remembered my selection such that ionic serve never allows me to select anymore and uses localhost...

如何更改此设置以便 ionic serve 使用第一个选项?

How can I change this so that ionic serve uses the first option?

Multiple addresses available.

Please select which address to use by entering its number from the list below:

 1) 192.168.2.10 (en0)
 2) localhost

Address Selection:  

推荐答案

您可以使用 ionic address 命令更新选定的地址,该地址在 Ionic 1.2.3 中可用.

You can use the ionic address command to update the selected address, which is available from Ionic 1.2.3.

此外,还有一个名为 ionic.config 的文件,您可以使用此设置对其进行修改.在 Mac/ubuntu 上,此文件位于 ~/.ionic.在 PC 上,它可以在 c:/users/username/.ionic 找到.在里面你会看到类似这样的东西,你可以编辑 ionicServeAddress 值.

Also, there is a file called ionic.config which you can modify with this setting. On Mac/ubuntu this file is at ~/.ionic. On a PC it can be found at c:/users/username/.ionic. Inside you'll see something like this which you can edit the ionicServeAddress value.

{
  "ank": "...",
  "versionCheck": 1413143560174,
  "ionicServeAddress": "localhost"
}

这篇关于ionic serve 显示多个地址,我选错了一个...如何更改 ionic serve 使用的地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 18:33