How do I open react-native's dev menu on real device

后端 未结 6 2035
萌比男神i
萌比男神i 2020-12-13 01:38

I have seen already a number of border cases and strange developer interface.

From the \"shake your device\", which is really impractical, specially with a tablet

6条回答
  •  青春惊慌失措
    2020-12-13 02:27

    Here is what I do:

    Android:

    Add a script to your package.json:

    "android-shake": "adb shell input keyevent 82"
    

    You will then be able to call yarn android-shake to have the menu popup on Android (as long as the device is connected to the computer that is).

    iOS

    Settings -> Accessibility -> AssistiveTouch

    1. Turn it on.
    2. Tap on Customize Top Level Menu...
    3. Remove all icons but one, and set it to shake.

    That will give you a button that you can tap instead of shaking the device.

    I hope this can help others.

提交回复
热议问题