Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable live reload in react native on android?

People also ask

How do I reload in React Native?

Pull to Refresh functionality is implemented using RefreshControl component in React Native. RefreshControl is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at scrollY: 0 , swiping down triggers an onRefresh event.

How are hot reloading and live reloading in React Native different?

The difference between the two is, Live Reloading is gonna reload your entire application. It's just gonna be like, okay, the file changed, reload the entire app. Hot Reloading is not gonna reload your entire application. It's just going to patch the code that was changed and keep the state in your app.

How does Hot reloading work in React Native?

Hot reloading allows you to see the changes that you have made in the code without reloading your entire app. Whenever you make any changes, all you need to do is save your code. As soon as you save your code, React Native tracks which files have changed since your last saved, and only reload those file for you.


  • Type the following in your command prompt to install and launch your app on the device or emulator:

    $ react-native run-android

  • Then click on emulator and press CTRL + M (CMD + M on MacOS) or shake the Android device which has the running app.

  • Then select the Enable Live Reload option from the popup.

    enter image description here


Executing the command, the configuration menu will appear adb shell input keyevent 82

Documentation


I was BLIND. It clearly states:

On Android shake the device or press hardware menu button (available on older devices and in most of the emulators, e.g. in genymotion you can press ⌘ + m or F2 to simulate hardware menu button click). You can also install Frappé, a tool for OS X, which allows you to emulate shaking of devices remotely. You can use ⌘ + Shift + R as a shortcut to trigger a shake from Frappé.


  • Using shortcuts: CTRL + M, or CMD + M (macOS)
  • From terminal: adbshell input keyevent 82

Important Note: Using Expo, make sure you are in development mode. The shortcuts will not work in production mode for Android emulator.

I did enable that through Expo XDE by tapping the cog next to the url and checking development mode. You may need to rebuild.

Expo - Development Mode


enter image description here