122

How can I enable live reload in the android emulator?

The documentation for android wasn't very helpful for a android noob.

itzmebibin
  • 9,199
  • 8
  • 48
  • 62
Kenneth Lynne
  • 15,461
  • 12
  • 63
  • 79

9 Answers9

268
  • 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

Tunvir Rahman Tusher
  • 6,421
  • 2
  • 37
  • 32
itzmebibin
  • 9,199
  • 8
  • 48
  • 62
51

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

Documentation

zishe
  • 10,665
  • 12
  • 64
  • 103
Jhony Taveira
  • 640
  • 5
  • 6
19

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é.

Kenneth Lynne
  • 15,461
  • 12
  • 63
  • 79
7
  • 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

Vahid Hallaji
  • 7,159
  • 5
  • 42
  • 51
6

I am using Redmi note 3 for debugging purpose and was facing similar issue. The solution was that MIUI by default disables popup permission for apps, which is needed in this case to get the reload screen. After enabling the popup permission for my app it works perfect. Hope it helps someone.

Ishwar Rimal
  • 1,071
  • 11
  • 19
6

For enabling Hot reloading or Live reloading on Device (external Android phone):

First, run the app using react-native run-android on Terminal.

Now, shake the Android device which has the running app.

Then select the Enable Hot Reloading or Enable Live Reload option from the popup.

nima
  • 7,796
  • 12
  • 36
  • 53
4

To enable live reload in React Native using Android you need to do the following steps:

  • Open you emulator;
  • Execute your application (react-native run-android);
  • Make sure that you application is running;
  • Click on emulator and press: CTRL + M.

Some options will be opened, and you select the "Enable Live Reload" as the image below. Click to see the image

Rodrigo Xavier
  • 222
  • 2
  • 6
2

I found out that, If I execute react-native run-android from the console, then changing and saving file (with any editor) don't reload the app.

But When I execute the app from VS code console, the live reload was working for every change and save.

I think you might need a IDE (such as VS code) for live reloading.

Shamsul Arefin
  • 1,771
  • 1
  • 21
  • 21
  • 1
    You can actually enable it by pressing menu key or CTRL+m and selection "Enable live reload" – Asce4s Mar 29 '19 at 06:39
1

If someone try to Open the In-App Developer Menu in react native

Android -> CTRL + M or you can shake your device as well

and

IOS -> ⌘ + m (CMD + M) or shake device

if for some reason IOS Simulator was not working with some reason try to open

simulator -> Hardware -> Shake Gesture ( For me ^⌘Z)

Wasi Sadman
  • 1,382
  • 1
  • 15
  • 27