Skip to main content

Accessing the developer menu on Android device with React Native using adb

Reloading a React Native app in the Android emulator is as easy as just double tapping the R key on the keyboard. But to do reload on device you need to bring up the developer menu to find the 'Reload' option. Shouldn't be that hard, right? You're just supposed to shake the device, or press the hardware menu button on older devices.

Well, my old ASUS device doesn't react to any shakes, and neither does it have a hardware menu button. So how do I open the menu? Couldn't find any information in the current React Native docs about it, but finally found a solution in this documentation for React Native v0.27! Don't know if things have changed between v0.27 and v0.43 to render the information obsolete, but at least it did the trick for me. Just type the following command from a command line:

adb shell input keyevent 82

It's also possible to exchange 82 for KEYCODE_MENU if you feel like typing a few more characters. :-)

adb shell input keyevent KEYCODE_MENU

Comments

Post a Comment