3

r restarts the Metro Bundler, but I have to shake my device and choose reload to restart the app on my device without restarting the entire bundler. I have to do this about 200 times a day and I'm going to get a repetitive strain injury if I don't find a better way.

Simply using "Live Reload" doesn't work for me because Expo's KeepAwake module no longer works and the device doesn't receive the signal to reload when the screen is off. The two-finger press that works on iOS doesn't work on Android.


Edit: This is not a duplicate. What works for React Native in general does not necessarily work for Expo. This is one of those cases.

Slbox
  • 10,957
  • 15
  • 54
  • 106
  • Possible duplicate of [Reload a React Native app on an Android device manually via command line](https://stackoverflow.com/questions/44170991/reload-a-react-native-app-on-an-android-device-manually-via-command-line) – Michael Cheng Jul 11 '19 at 19:44
  • Very closely related, but not a duplicate. Expo is connecting over LAN, not a USB connection, so all the answers that apply to React Native don't necessarily apply to Expo. None of the answers in that thread helped me, sadly. – Slbox Jul 11 '19 at 20:00
  • How about creating a HOC that implements the two finger press feature that exists on iOS but for Android instead? Then just using that while you are in development mode. Prior to that iOS feature existing, you had to implement it yourself [like this](https://stackoverflow.com/questions/46101581/open-ios-developer-menu-programmatically-command/46102127). – Michael Cheng Jul 12 '19 at 15:29
  • That is if you absolutely cannot use a USB connection. I haven't used React Native for a very long time, but I have scripts that allowed me to run that command I linked to above for the same reason. If something about the LAN is interfering with that from working, then the fix for that may be [this part of the Expo documentation](https://docs.expo.io/versions/latest/workflow/debugging/#troubleshooting-localhost-debugging). – Michael Cheng Jul 12 '19 at 15:31

1 Answers1

1

Theoretically this is now possible in SDK 43, but I've not yet tried it.

You can now press r to reload your app in Expo Go. Xcode 12 introduced the ⌘+r simulator shortcut for “Record Screen”, and so to avoid clashing with that shortcut you can now reload by just pressing r (as long as a text input is not focused). ⌘+r will also continue to work. -- Source

Slbox
  • 10,957
  • 15
  • 54
  • 106