问题
So I am trying out Ionic 2. I found out this Ionic Cli command does not work:
ionic emulate ios --livereload
or
ionic emulate ios --lc
It show "Setup Live Reload" in the log but the app just hang in the opening splash screen. Can not find further error in the log (no error output), but the whole thing is frozen. It work without the -lc flag. So if I just run
ionic emulate ios
It works and the app launch. Anyone know a workaround for this? I am on iOs 9.3.
回答1:
I faced the same issue and these are the steps I followed:
- Open the root folder of the app.
- Find
config.xml
file. - Look for the line
<allow-navigation href="" />
- Change it to
<allow-navigation href="http://YOUR_IP_ADDRESS:8100/" />
and save. Eg.<allow-navigation href="http://192.168.118.25:8100/" />
- Now run the
ionic emulate ios -lcs
command again.
This time it should work perfectly on your simulator.
回答2:
excute ionic address first
then excute ionic emulate ios --livereload
after some step, you have to choose a IP. Choose what ever you want and it will work!
来源:https://stackoverflow.com/questions/38065902/ionic-2-cli-command-ionic-emulate-ios-livereload-not-working-on-ios-9