本文介绍了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...

如何改变这一点,以便离子服务使用第一个选项?

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 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显示多个地址,我选择了错误的一个...如何更改离子服务使用的地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 20:05