4

How to run ionic cordova live-reload on ios ?

Following to the ionicframework' doc ionic cordova run ios -l --external command will "start a live-reload server on all addresses and deploy the app to an iOS device using Cordova"

Well for me it logs out

> ng run app:ionic-cordova-serve --host=0.0.0.0 --port=8100 --platform=ios
[ng] An unhandled exception occurred: context.getProjectMetadata is not a function
[ng] See "/private/var/folders/g3/z8_4pwdj0ps1jdm9bnt8dcrc0000gn/T/ng-GhO4vZ/angular-errors.log" for further details.

[ERROR] ng has unexpectedly closed (exit code 127).

I tried to replace the plateform ios by the browser one but I got the same error.

angular-errors.log : angular-error

Note that running ionic cordova run ios --external without -l works well, http://172.20.10.3:8000/ shows my webapp.

Anyone has manage to make the live-reload works on IOS ? And how ?

crg
  • 4,284
  • 2
  • 29
  • 57

1 Answers1

0

For Ionic 5 apps I use the following to run in a WKWebView (of my custom debug app binary) or Mobile Safari browser on iOS:

ionic serve --no-open --consolelogs --external

--no-open suppresses the launching of a browser tab

--consolelogs console logs to the command line

--external makes it available on your local network

I then load the development machine IP address and port in my WKWebView (via UI form fields) or browser location bar and I get live reload debugging as I code. e.g. http://192.168.1.3:8100

https://ionicframework.com/docs/cli/commands/serve

TaeKwonJoe
  • 1,077
  • 11
  • 24