Coder Social home page Coder Social logo

Comments (15)

gnl avatar gnl commented on July 21, 2024

Adding this to project.clj didn't help either:

:figwheel {:websocket-url "ws://<my-ip-address>:3449/figwheel-ws"}

from re-natal.

cldwalker avatar cldwalker commented on July 21, 2024

I just made live reloading on a iOS device work by changing references to localhost to MYIP in AppDelegate.m, index.ios.js and env/ios/main.cljs.

To make this easier I'd propose a use-ios-device command that like the android command has a key in .re-natal and updates these files. iosHost would default to localhost like androidHost. @drapanjanas Does this approach sound reasonable? If so, I'm happy to make a PR

from re-natal.

drapanjanas avatar drapanjanas commented on July 21, 2024

I have no iOS device so will not be able to help much... so live coding does not work when you connect usb right? Or do you use wifi? For example, on android device localhost works fine when connected via usb, but to use simulator you need to use special IP.
@cldwalker yep we could introduce use-ios-device. Too bad we need to change AppDelegate.m, but that is easy with regex. So what would be the interface? Smth like re-natal use-ios-device my.ip.addr? or you have something else in mind? I guess we even could resolve ip if not specified but that is more nice to have feature. I will be glad to merge PR for this.

from re-natal.

drapanjanas avatar drapanjanas commented on July 21, 2024

Or re-natal use-ios-device real|simulator? 'simulator' parameter would set the localhost and 'real' would resolve and set your en0 ip. What do you think?

from re-natal.

gnl avatar gnl commented on July 21, 2024

re-natal use-ios-device with similar behaviour to the android command sounds great, but we should definitely have a parameter for the exact IP address - on machines with multiple network interfaces (like mine) en0 might end up being the wrong interface.

And I'm connecting through wifi, I don't think there's any way to do it over USB (even though it would be nice, but that doesn't seem to set up any kind of network interface).

from re-natal.

cldwalker avatar cldwalker commented on July 21, 2024

@drapanjanas My ios device connects through usb. re-natal use-ios-device real|simulator sounds good. I would use ipconfig getifaddr en0 to get the IP for device. I agree with @gnl that we should also allow IP. If the value isn't 'real' or 'simulator' we could just substitute with the given arg/IP. Sound good?

from re-natal.

gnl avatar gnl commented on July 21, 2024

@cldwalker - I'm pretty sure I edited the exact same files (AppDelegate.m, index.ios.js and env/ios/main.cljs) and I also set the :server-ip figwheel option to 0.0.0.0 to get figwheel to listen on all interfaces.

I was able to connect and get the app to run (the connection to the react packager worked just fine) but there was no connection to the figwheel repl (started with rlwrap lein figwheel ios) and thus no live reloading.

A tcpdump on port 3449 showed no connection attempt from the figwheel client (running on my iphone) and looking at the compiled files I mentioned in my first comment, the settings didn't seem to have any effect, the websocket url was still pointing to localhost.

from re-natal.

cldwalker avatar cldwalker commented on July 21, 2024

@drapanjanas And yes live coding iOS device live coding doesn't work until I changed those three files

from re-natal.

drapanjanas avatar drapanjanas commented on July 21, 2024

@gnl I agree, we should be able to set an exact IP address. I will also implement the same for android afterwards. Feel free to design and submit the PR for use-ios-device command! @cldwalker yes, sounds great!

from re-natal.

gnl avatar gnl commented on July 21, 2024

Great, thank you!

from re-natal.

drapanjanas avatar drapanjanas commented on July 21, 2024

@gnl have you tried to restart packager after you have changed all these files? I sometimes experienced that my changes of index.ios.js was not active for some reason.

from re-natal.

gnl avatar gnl commented on July 21, 2024

@drapanjanas - yes, tried pretty much every possible combination of restarting the packager, including with the --reset-cache option and cleaning / rebuilding the cljs build, nothing.

from re-natal.

gnl avatar gnl commented on July 21, 2024

It's certainly possible that I might have missed something, so I'll just test again and help debug if there's any issues after @cldwalker submits his pull request.

from re-natal.

gnl avatar gnl commented on July 21, 2024

Just tried this again - editing/confirming the edits in AppDelegate.m, index.ios.js and env/dev/ios/main.cljs, resetting the packager cache and doing a clean build and I can confirm now that live code reloading works with an ios device. I can't think of anything I did differently before, but I guess I must have missed something.

from re-natal.

gnl avatar gnl commented on July 21, 2024

Works great, thank you!

from re-natal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.