Comments (15)
Adding this to project.clj didn't help either:
:figwheel {:websocket-url "ws://<my-ip-address>:3449/figwheel-ws"}
from re-natal.
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.
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.
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.
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.
@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.
@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.
@drapanjanas And yes live coding iOS device live coding doesn't work until I changed those three files
from re-natal.
@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.
Great, thank you!
from re-natal.
@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.
@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.
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.
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.
Works great, thank you!
from re-natal.
Related Issues (20)
- issue with loading JS files on real device with RN debugger HOT 1
- Choppy pull-to-refresh with `ScrollView` and `FlatList` HOT 1
- Crash on new project - npm install failed. HOT 1
- SOLVED: undefined is not a valid argument for 'in' (evaluating 'StopIteration' in goog.global) HOT 1
- Enabling auto-require breaks re-natal HOT 2
- support shadow-cljs HOT 3
- Android emulator can't load application when debugging is enabled HOT 1
- Incorrect jvm --add-modules options HOT 1
- Is there a way to run a dev environment in the browser ?
- Requiring goog breaks reloading with Namespace already declared
- Use of undeclared Var cljs.user/start-figwheel
- Unable to connect to a component in a module.
- Unknown argument type __attribute__ in method -[RCTUIManager... HOT 1
- Cider-jack-in not working with re-natal. HOT 1
- prn statements not showing on Figwheel
- Feature request: data-url in image source.
- moving to RN 0.6x HOT 3
- Node process figwheel bridge unexpected token error.
- Command failed: lein prod-build HOT 1
- Stuck on Prompt will Show when Figwheel connects to your application.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from re-natal.