question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] ionice run ios --live-reload not reloading on file change

See original GitHub issue

The issue: When I run my project with live-reload the emulator/device is not being updated when I change my source files.

ionic run ios -c --live-reload
Running 'run:before' gulp task before run
[14:26:39] Starting 'clean'...
[14:26:39] Finished 'clean' after 20 ms
[14:26:39] Starting 'build'...
[14:26:39] Starting 'sass'...
[14:26:39] Starting 'html'...
[14:26:39] Starting 'fonts'...
[14:26:39] Starting 'scripts'...
[14:26:39] Finished 'scripts' after 67 ms
[14:26:39] Finished 'html' after 103 ms
[14:26:39] Finished 'fonts' after 110 ms
[14:26:40] Finished 'sass' after 928 ms
[14:26:55] Finished 'build' after 16 s
[14:26:55] Starting 'run:before'...
[14:26:55] Finished 'run:before' after 6.7 μs

Setup Live Reload
Running live reload server: http://10.0.0.120:35729
Watching: www/**/*, !www/lib/**/*
√ Running dev server:  http://10.0.0.120:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

Now, if I change anything in my project (let’s say app/app.ts) the emulator/device does not reload.

I think it’s because the ‘watch’ task in gulp is not being run.

Workaround If I open another terminal window and run this command in my project folder, live reload works as expected:

gulp watch
[14:31:28] Using gulpfile ~/ionic/ionic-projects/PortalShopApp/gulpfile.js
[14:31:28] Starting 'clean'...
[14:31:28] Finished 'clean' after 18 ms
[14:31:28] Starting 'watch'...
[14:31:28] Starting 'sass'...
[14:31:28] Starting 'html'...
[14:31:28] Starting 'fonts'...
[14:31:28] Starting 'scripts'...
[14:31:28] Finished 'scripts' after 80 ms
[14:31:28] Finished 'html' after 109 ms
[14:31:28] Finished 'fonts' after 109 ms
[14:31:29] Finished 'sass' after 1.19 s
7.3 MB bytes written (11.42 seconds)
[14:31:43] Finished 'watch' after 15 s
[14:31:55] Starting 'html'... <--- I changed app/pages/login/login.html and it started 'html' task like expected
[14:31:55] Finished 'html' after 12 ms

This should happen automatically, right?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rspachcommented, Jul 30, 2016

Have the same issue in the emulate command. The changes I make in the app folder are not updated.

I run the command

$ ionic emulate ios --livereload --address localhost --consolelogs --serverlogs

Nothing is updated. I then have to open a new terminal and run the command

$ gulp watch

Then all updates are processed correctly.

$ ionic info

Your system information:

Cordova CLI: 6.3.0
Gulp version:  CLI version 3.9.1
Gulp local:  
Ionic CLI Version: 2.0.0-beta.35
Ionic App Lib Version: 2.0.0-beta.19
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v6.3.0
Xcode version: Xcode 7.3.1 Build version 7D1014 
0reactions
ionitron-bot[bot]commented, Jul 12, 2018

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic live reload feature not reloading application
Try running ionic address and selecting the correct interface. If it doesn't work and it's iOS 9, it may be an issue with...
Read more >
Ios device live reload not working - Ionic Forum
Everything loads fine and runs fine the first time I build for my ios device using: ionic cordova run ios --device -l -c....
Read more >
Live Reload | Capacitor Documentation
The Ionic CLI includes a complete Live Reload experience, automating all of the steps that are detailed manually below. Install it along with...
Read more >
Running React with Ionic Capacitor & Live Reload
Cover image for Running React with Ionic Capacitor & Live Reload ... DiskCookieStorage changing policy from 2 to 0, cookie file: file:/// ...
Read more >
Live Reload All the Things: Ionic CLI's Latest Features
Not only can you run LiveReload, you can also access console logs from the device and server logs showing which files the device...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found