React: Capacitor live reload not working
See original GitHub issueI have setup Ionic React in my NX workspace using the @nxext/ionic-react
generator and have successfully added iOS as one of my target platforms.
What is not clear to from the docs of @nxext/ionic-react
is how to get a development environment with livereload in the iOS Simulator working.
I have tried the following command which does start the simulator as expected
nx run client:cap --cmd="run ios -l --external"
however the process exists immediately after the project is built and the simulator is started.
I have setup Ionic with Capacitor in a non NX environment before, and from this experience the expected behaviour is for the process to stay alive and livereload the app which is running in the simulator.
What am I missing
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ionic4 - Capacitor livereload not working - Stack Overflow
I'm running this command ionic cap run ios -l which add my local ip address to capacitor.config.json . however, it seems like I'm...
Read more >Live Reload | Capacitor Documentation
Use Live Reload to easily debug the web and native portions of an app on a device or simulator.
Read more >Ionic capacitor live reload not working on android
I am using the following command to perform live reloading on android ionic capacitor run android --livereload --external. But it is not ...
Read more >Running React with Ionic Capacitor & Live Reload
When running capacitor with livereload on android devices and emulators there is an issue you will most likely run into. This issue can...
Read more >Running React with Ionic Capacitor & Live Reload - YouTube
reactjs #javascript #ionic####SEE UPDATED VIDEO HERE https://youtu.be/Sx1LlavDgMg#######Learn Ionic Framework with ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@johnnyBira Thank you so much, finally a solution that worked for me! For anybody else wondering how to configure the
server.url
: I used theip
package which helps you dynamically setting that value like so:My current recipe is sceptic to iOS, but I’m sure it can be extended to include other platforms:
capacitor-config.ts
.packages/{package-name}/capacitor-config.ts
project.json
with the following config:/package/{package-name}/project.json
Using Capacitor
nx run {package-name}:cap -cmd “run ios -l --external” Or do what I did and create a shorthand in
project.json
:Now you can run this to start the iOS simulator instead:
Using XCode
Run:
This will open Xcode, where you can click the play button to start the app in your selected simulator