Ionic-cli: Provide live-reload functionality

Created on 10 May 2018  路  8Comments  路  Source: ionic-team/ionic-cli

Like ionic cordova run ios -l, but for Capacitor!

馃摑 Set appUrl in capacitor.config.json for live-reload: https://github.com/ionic-team/capacitor/issues/366 & https://github.com/ionic-team/capacitor/commit/9b89f096e8eca1f7ef761c4f1cc3be2e7c16ab9b

capacitor enhancement

Most helpful comment

In the meantime here is the description we wrote for our project on how to use live-reload:

  1. Create a Wifi hotspot from your laptop (iPhone and Laptop need to be on the same network)
  2. Run ionic serve
  3. Find your IP (ifconfig on Mac)
  4. Check that you can access the website from the phone in Safari
  5. Add your Laptops IP as server in the capacitor.config.json
  6. Run cap sync ios and tehn cap open ios
  7. Start the project in XCode
  8. Enjoy 馃槉

Server config for capacitor:

"server": {
  "url": "http://[Your IP here]:8100"
}

Hopefully it helps someone while we are waiting for awesome cli support.

All 8 comments

Status of this issue is somehow unclear. Is it possible to add live-reload functionality to the Capacitor right now or no?

Perhaps the "enhancement" label will help.

It is not possible yet. Subscribe to this issue for updates.

In the meantime here is the description we wrote for our project on how to use live-reload:

  1. Create a Wifi hotspot from your laptop (iPhone and Laptop need to be on the same network)
  2. Run ionic serve
  3. Find your IP (ifconfig on Mac)
  4. Check that you can access the website from the phone in Safari
  5. Add your Laptops IP as server in the capacitor.config.json
  6. Run cap sync ios and tehn cap open ios
  7. Start the project in XCode
  8. Enjoy 馃槉

Server config for capacitor:

"server": {
  "url": "http://[Your IP here]:8100"
}

Hopefully it helps someone while we are waiting for awesome cli support.

Thanks @HoverBaum! Those are the exact steps we hope to automate. I was working on this yesterday but ran into some issues with Capacitor misidentifying ios/android as web due to the livereload server. Hoping to resolve this shortly!

Does it work now, the documentation still says no but github says closed :)

@darklinki Yes, it should work. Can you link to the documentation you're seeing?

@dwieeb - This is the documentation @darklinki was reffering to

Oops! Thanks @linus1412!!

Was this page helpful?
0 / 5 - 0 ratings