Run and emulate ios with live reload not working in iOS9

I have tried almost everything… fresh builds, fixing hostnames, enabling/disabling IPv6, re-downloading Xcode, blowing away and re-configuring simulators. It’s some kind of environmental bug. I spent some time going through ideas with one of the Ionic guys and we’re both stumped. At this point I’m going to just keep using a real device for development and hope that someone upstream finally figures out what’s going on… :frowning:

Same here, also tried EVERYTHING, updated ios-sim and ios-deploy as well, tried different cordova-ios versions also, also using angular 1.4.6 but also with the io9patch since I still noticed issues with the routing eventhough it should have been fixed in 1.4.6 (which is probably not the case).
But with the -l flag I can still get the instance running, but the livereloading does not work at all…
It is really slowing my dev-cycle down like crazy whished I didnt updated everything to ios9 and xcode7.

One thing i did not see yet here is the cordova whitelist plugin, it doesn’t load since the cordova-ios version is nog yet ‘4’.
So you need to add

<plugin name="cordova-plugin-whitelist" spec="1.0.0"/>

to your config.xml and re-add the ios platform, or use ionic state reset
this will probably let you use the -l flag again, but the livereloading itself won’t work :frowning:

EDIT: It’s working now - I also REMOVED this from my Index.html

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

So with the WORKING whitelist plugin, <key>NSAllowsArbitraryLoads</key><true/> in my Info.plist and the index.html security rule removed Livereloading is working again in the Simulator.

One little problem is still there; running the emulator with ionic emulate always results in a black screen - but after doing a content reset and not closing the emulator after the first run, it continues to work, but I do need to reset the content each first run.

1 Like

I have the same issue after updating el capitan & ios 9, Actually if you see the console log on the safari(no port number displayed in the safari developer menu so i need to choose the blank port) it reads ‘nativeEvalAndFetch : ReferenceError: Can’t find variable: cordova’. But the issue disappears when i connect to the VPN network. After i connected to the VPN network it asks me to choose the port then i choose the VPN port(which reads pppo). Good luck.

Hm, tried setting the plugin and that didn’t help for me; neither did additionally removing my CSP line. Still no good, here. :frowning:

Same problem here with the captain. If you start try to execute the project with Xcode you’ll likely get the following error: “Failed to load webpage with error: Not allowed to use restricted network port”
… trying to figure out how to get that sorted now.

I’m now on at this stage: Live Reload Error: Failed to load webpage with error

same problem here… using El Capitan and ios 9.

I’m blocked… I can’t work :frowning:

I believe I am running into the same thing as people in this thread:

  • working code with respect to file handling in Xcode 6.
  • under xcode 7 and any simulator or device I can 't view local pictures anymore. Error: “not allowed to load local resource”

I have done everything the internet suggest so far: whitelisting plugin, whitelist in angular, Content-security policy. I can 't work like this. Has anyone come up with a solution yet?

OK, I got it to work by deinstallign a plugin that I used to overcome my IOS 9 problems(https://github.com/Telerik-Verified-Plugins/WKWebView).

what is the steps to do it?

I have the same problem as @RangerRick, except mine fails on both simulator and device when the -l option is set. The error message is:

Failed to load webpage with error: The operation couldn’t be completed. No such file or directory.

Environment: El Capitan, Xcode 7.0.1 and iOS 9.0.2.

In my case, the “ionic build ios” quits right after JSHINT. Android build work fine. ANY idea of this issue? The cordova/xcode build is not even running for IOS.

And yes, I tried this on 2 different iMac’s and my Macbook Pro.

Same issue here since i installed el capitan… Anybody found the magic solution?

@mib200: Which node version are you using? I had problems with the newest node.js 4.0 but since downgrading to 0.12.7 building works fine again.

See also: Live Reload Error: Failed to load webpage with error

1 Like

I was having the same problems as everyone else. Was working fine when I added to the p.list file, then updated to El Capitan and everything was back to blank screen.

I FOUND A SOLUTION:
Go to Xcode and download the 8.4 version of iOS Simulator
XCode > Preferences > Downloads > select 8.4 simulator

Go to iOS Simulator
Hardware > Device > Manage Devices > remove the devices that use iOS9

I know its not the best solution, but it will do until they find a fix for this iOS9 Simulator issue

1 Like

Updated to El Capitan and now iOS9 doesn’t work anymore with services running on the local address…
And Ionic is also a service running on the local address.

You can find different cases on stackoverflow and apple forum where it comes down to not able to reach your own local computers services/IP

So one solution could be downgrading the iOS version as suggested by outfitpic till this is fixed.
But a work around (not yet tested since i don’t know if it is possible) could be running Ionic from a different (internal) host.
This is also the reason why Seeni suggested in this topic VPN was working for him.
Because you are connecting to Ionic from a different IP than your own local IP.

To be clear, it is not related to the App Transport Security, and yes you also need to enable this but it will NOT solve connecting to your simulator’s local IP address.

Also, when installing iOS 8.4 you could run into another issue with El Capitan (Failed to install) you can find a solution here.

Hope this helps people who are also searching the Web in frustration :smile:

Also, could someone open a Bug report at Apple?
I currently do not own (myself) a dev account @ Apple.

1 Like

This works, thanks! Alternatively to deleting iOS9 devices, just select Hardware > Devices > iOS 8.4 then tap to launch the app.

It’s working for me as well rather than updating Info.plist file. No need to delete any emulator, but I wonder if it is possible to set a default device/iOS version to emulate or set the right device/iOS version when emulating with livereload.

So far, listing the devices in my system (OSX 10.10.5) I get:

iPhone-4s, 8.4
iPhone-4s, 9.1
iPhone-5, 8.4
iPhone-5, 9.1
iPhone-5s, 8.4
iPhone-5s, 9.1
iPhone-6, 8.4
iPhone-6, 9.1
iPhone-6-Plus, 8.4
iPhone-6-Plus, 9.1
iPad-2, 8.4
iPad-2, 9.1
iPad-Retina, 8.4
iPad-Retina, 9.1
iPad-Air, 8.4
iPad-Air, 9.1
iPhone-6s, 9.1
iPhone-6s-Plus, 9.1
iPad-Air-2, 9.1
iPad-Pro, 9.1
Apple-TV-1080p, tvOS 9.0
Apple-Watch-38mm, watchOS 2.0

But, if in fact I can successfully run ionic emulate -l -c --target='iPhone-5s' --debug ios, then changing from 9.1 to 8.4 emulator iOS version, running ionic emulate -l -c --target='iPhone-5s, 8.4' --debug ios outs:

(...)
Running command: /Users/telekosmos/DevOps/phonegap/lodashdb/platforms/ios/cordova/run --emulator --debug "--target=iPhone-5s, 8.4"
iPhone-5s, 8.4 is not a valid target for emulator
Error: /Users/telekosmos/DevOps/phonegap/lodashdb/platforms/ios/cordova/run: Command failed with exit code 2
    at ChildProcess.whenDone (/Users/telekosmos/.nvm/versions/node/v0.12.7/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
(...)

Any chance to set the version along with the device?

Cheers!

Check out the issue here, there may be a way to get Cordova to use the full list from ios-sim showdevicetypes: https://github.com/driftyco/ionic-cli/issues/317