Running Ionic app with livereload with remote Mac Computer [SOLVED]


#1

[EDIT]
Problem solved !
I’ll share how I did this for those who might want to do the same. To explain, I wanted to build my app for ios remotly (on a mac mini server home, or a mac VPS), while developping and building for android on my Linux laptop.
It’s pretty straightforward to perform a simple build (and even run the app on a iDevice plugged to the laptop with a USB over IP software).

I pull the content of my project Git repo on the Mac server each time I want to build for ios (after I pushed from my Laptop).

However livereload was not that simple, I needed to split the build and serve parts of the ionic cordova run ios --livereload as described under.
This way the Mac Server will perform the installation, but the app installed will have it’s livereloaded content served on the Linux laptop.

On the Laptop, I had to add the ios platform (even if I can’t build it on Linux obviously), I assume Ionic needs it to serve cordova.js :

ionic cordova platform add ios

Then we can run the livereload server that will serve content to the iDevice :

npm run start --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser --iscordovaserve --platform ios --target cordova

On the Mac Server, I had to manually change the content tag src from config.xml with my Laptop ip :

 <content src="http://192.168.1.4:8100" />

And also allow-navigation for this IP :

  <allow-navigation href="http://192.168.1.4:8100" />

Then we can run the app ! (without ionic prefix) :

cordova run ios --device

The app will look for it’s content on the IP you manually entered in config.xml.
If you automate the whole process, it’s juste like you could build ios app on your Windows/Linux computer (with a cheap Mac mini server at home or a Mac VPS).

[Original post]

Hello !
I have a specific request, I would like to build and run an iOS app with livereload, but with the --address pointing to another computer (which will serve the app content),

The idea is to have the “build” part of ionic cordova run ios --livereload running on one device,
and the “serve” part running on another,

Do you have any clue how I could split the process this way ?
Thanks !