'React native Ctrl M or dev tool not showing in my emulator

He thanks in advance, In react native am not able to right click or open dev mode in emulator.



Solution 1:[1]

adb shell input keyevent 82

Use this in your windows command line, It works for me.

Solution 2:[2]

If the above solutions did not help, here is what worked for me.

  1. Use an emulator that has Play Store installed. When creating a virtual device in Android Studio, it will have the Play Store icon.
  2. Download Expo from the play store. For some reason, the Expo app that vscode pushes to my emulator won't work properly for me.
  3. Run expo start and open the Expo Developer Tools page on your browser (by typing 'd' if it does not open automatically), and copy the url at the bottom left. Will look like exp://127.0.0.1:19000 if you started with --localhost
  4. On the emulator, run the expo app and on the top select Open from Clipboard and it will show the url you copied.

For me, this did a better job at starting the Building Javascript bundle, and once the app was loaded, I was able to use Ctrl M to mimic shaking the device and open the developer menu!

Other troubleshooting tips I learned while figuring this out:

  • Like the comments above state, don't be in production mode

  • Make sure to have paths set up correctly to be able to reach your Android sdk, nodejs, and your local project node_modules/bin if you are not doing global npm installs.

  • If you are having issues with remote debugging, make sure the Chrome debugger is not open. Close it if it is open, have your debugger listening on the correct port (for me 19001) and reload the project on the device.

I hope this helps someone.

Solution 3:[3]

FOR WINDOWS 10 YOU NEED TO ADD THIS SO THAT YOU CAN USE CRTL+M to open debug and reload

Add environment variables

Open a File Explorer, copy and paste the following into the address bar.

Control Panel\System and Security\System

Click on Advanced system settings on the left menu.

Click on Environmental Variables at the bottom.

Click on New to add a user variable (the top section).

You’ll be adding two:

Variable Value
ANDROID_HOME C:\Users\username\AppData\Local\Android\Sdk

JAVA_HOME C:\Program Files\Android\Android Studio\jre\jre

Then under System variables (the bottom section), click on the Path variable and click on Edit.

On the pop-up window, click on New to add another variable:

C:\Users\username\AppData\Local\Android\Sdk\platform-tools C:\Program Files\nodejs\

Click OK, OK

Then try your emulator see this link: https://medium.com/@lpault29/react-native-environment-for-windows-e25806df867c

Solution 4:[4]

Turning off production mode solved my problem.

Solution 5:[5]

There is post which says turn off production mode -> it took me time to find in which settings -> I was looking in emulator settings, it was in expo-cli. This post is it clarify it.

  1. Production mode off

In the expo-cli http://localhost:19002/, there is Production Mode (left side bar) -> turn it off

  1. Open AVD Emulator and your application, press ctrl+M

It should work.

Solution 6:[6]

Make sure we installed all of these SDK files *Make sure we installed all of these SDK files,I tried all of the above solutions but no one solved my problem but everything is working now after doing this, hope it will solve your problem also

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ankit Jayaprakash
Solution 2 D. Smith
Solution 3 Angelica Payawal
Solution 4 Furkan
Solution 5 Rady
Solution 6 Ajay Pandey