Is there a way to reload the device from the chrome console in React Native so I don't have to constantly shake it?

Viewed 288

It's easy in the simulator--you just press command+R.

But on the phone, you have to constantly shake it, and that really disturbs your workflow, especially when for like the first time in history everything live-codes beautifully.

What's the easiest way to reload my app without shaking it? Stopping and playing and Xcode is worse--so that's not an option. I would like to do the closest thing to command+R but for the device instead of the simulator.

1 Answers

I've found a workaround for now using adb shell:

adb shell am force-stop com.app_name && adb shell am start -n com.app_name/com.app_name.MainActivity

u can optimize that by using the restart shell command, but that has security restrictions you'll need to work through.

I might look later into the react-native way of doing that.

Hope this helps.

Related