How to temporarily disable rage shake opening the dev menu in react-native? - react-native

I'm developing an app in react-native for Android. I recently added a barcode scanning component. Whenever the scanner reads a barcode, the camera does a subtle click noise. It seems that this clicking is enough to trigger the "shake" required to open the developer menu.
Is there any way I can disable this shortcut programmatically? I would like to disable the shortcut when the barcode scanner is running and then enable it again later.

This is currently not possible. A PR allowing this was recently (may/2017) merged, but only adds support for this on ios: https://github.com/facebook/react-native/pull/13563

You can't. You could try disabling the camera shutter sound though.

Try to run release version of an app. Run react-native run-android --variant=release for more details to generate signed apk follow guide here

You can put the phone on silent mode, hope this helps!

Related

React native while debugging pointing issue

When enabling "Debugging" in the ios simulator and open chrome for debugging.
The first time works perfectly but when change code and refresh automatically.
After that Debugging points somewhere else. I understand there is a mapping issue while debugging.
Any solution for this?
Debugging mapping attached to the project when we start project or reload but at the time of hot reloading (auto refresh) will not update that mapping correctly.
For update the mapping correctly you have to reload it.
In physical devices: Shake the device it will open a window choose 'reload' option.
For simulator: by pressing command+R or command+control+z and choose 'reload' option.
For emulator mac OS: by pressing r+r (2 times).
In chrome developer tools, try switching to network tab, and check "Disable cache". It might help

how to connect app to development server and makes it sensitive to changes?

I'm working on an app that was developed by someone else and referred to me for debugging. I downloaded the project from git and now when I install it on my android device using the react-native run-android command and change the codes and save it, nothing happens in the app and I have to reinstall using "react-native run-android" to see the changes. what should I do to see the changes online?
The solution was quite simple. The only thing I had to do was to shake the device and click on "enable hot reloading" in the opened menu.
Try to clean the Gradle and run again. and also check are you able to get developer menu by clicking ctrl/command + m.

Missing Debug JS Remotely option in Developer Menu

In order to use React Native Debugger, I don't see the option 'Debug JS Remotely' when I open the Developer Menu both on my android simulator and my physical device, using expo. Tried both scenarios and no option for Debug JS Remotely...
(I originally wanted to use my external device with React Native Debugger and I can't find the setupDevtools.js file at node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js in order to update this file for use. I don't know if these two might be related, but also wanted to share)
Am I missing something? Thank you...
I guess the option Debug JS Remotely has been replaced by the option Debug with the latest version of react-native.
And If you want to use your external device with a debugger just shake the device and select the debug option from the developer menu.
But as #JoeBe suggested you should also look for an already open debugger and then try it.
You can also open the developer menu just by pressing d on node.js screen if you are using the latest version of react-native.
I had the same issue. But as it turns out, after terminating all other debuggers it was working with that Debug option as well.

Switching between Expo Apps Running on Android Emulator

I am sorry for the trivial question!
While testing an Expo (react-native) app on Android Emulator, I need to switch to other apps, e.g. to the Contacts Manager to add a contact. Then, I need to go back to the Expo app to test something. How can I do that?
I tried the following.
Start the Expo app and play with it
Press the Home button
Start Contacts Manager
I could NOT find a way to start the Expo app again. I found an Expo icon in the list of apps. When I clicked on it, a screen with everything disabled, except "Open from Clipboard" appeared. The "Open from Clipboard" option seems to be for switching between different Expo apps. Anyway, when I clicked on it, I got the following error message.
Something went wrong. Could not load exp://switching/%20between%20Expo%20apps%20running%20on%20Android%20Emulator.
Environment:
Expo: 32.0.0
Android Emulator: API: 25 - Android 7.1.1 x86 - Nexus S
Thank you for your effort and time to help...
Are you using a connection localhost? if yes, on the terminal, try to press 'a'.

How do i install a react-native debug build to device with production-like optimized performance?

I want to use my app on my phone with smooth animation and production-like performance, but i want it to show red screen whenever error happens and to be possible to debug this app with remote-chrome-debugging. How do i do that?
For Android, you can just open the developer menu by shaking the device or emulator, and in Dev Settings, uncheck 'JS Dev Mode'. Also you can tweak other options if you are interested. As for iOS, I am not entirely sure how you can do it.