- Copy the following
Gemfile
,Guardfile
,config/environments/development.rb
, thenbundle
- Configure your Android devices (see https://developers.google.com/chrome-developer-tools/docs/remote-debugging?hl=it#reverse-port-forwarding)
- In Chrome port forwarding settings set two forwards:
- 8080 => localhost:3000
- 5729 => localhost:5729
- Connect as much Android devices as possible (like this)
- Enjoy!
Last active
May 19, 2020 10:19
-
-
Save nebirhos/7658976 to your computer and use it in GitHub Desktop.
Multi device Guard::LiveReload with Chrome Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/environments/development.rb | |
MyRailsAwesomeApp::Application.configure do | |
... | |
# Automatically inject JavaScript needed for LiveReload | |
config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload, live_reload_port: 5729) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :development do | |
gem 'guard-livereload', require: false | |
gem 'rack-livereload' | |
gem 'rb-inotify', require: false # linux | |
gem 'rb-fsevent', require: false # os x | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'livereload', port: '5729' do | |
watch(%r{app/views/.+\.(erb|haml|slim)$}) | |
watch(%r{app/helpers/.+\.rb}) | |
watch(%r{public/.+\.(css|js|html)}) | |
watch(%r{config/locales/.+\.yml}) | |
# Rails Assets Pipeline | |
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|jpg|png))).*}) { |m| "/assets/#{m[3]}" } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is awesome. Thanks