Can't Open Developer Menu
I am on React Native 0.17.0 and trying to open the Developer Menu by shaking the simulator(Hardware> Shake Gesture) after downloading code from my local server. Nothing appears.
My schemes and build configurations are not named "Debug" and "Release". Are the names of the configuration important to making the developer menu work? Or perhaps can I directly include some variable in the .xcconfig files?
Hey jkhustler, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
- If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag
react-nativeor for more real time interactions, ask on Discord in the #react-native channel. - If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
- We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!
yeah you must be in Debug mode for the dev menu to works.
How have you bootstrapped the project? If you bootstrap with react-native init you should have the 2 modes available in Product → Scheme → Edit Scheme... (or press ⌘ + <).
I am integrating react native with a pre-existing project. So React Native literally looks at the name of the build configuration and not a flag inside the actual build configuration file?
I've made custom schemes named "Local", "Staging", "Prod" and "Release" and corresponding build configurations. So I don't have a "Debug" configuration.
I ran into the same issue. It would be nice if the dev menu wasn't tied to the configuration name. This basically limits us to one config for development. I have defined some others, and can't reload or debug with these.
@mikeygee @jkhustler You can customise whether to enable dev menu in MainActivity.
@satya164 This issue applies to XCode / iOS development
@mikeygee Ah. I'm sure there should be something in iOS for this also. Need to check.
Yes something like that for iOS would be tremendously helpful.
Can anyone with iOS experience try to debug why this happens?
@nicklockwood is there an obvious place where we rely on the configuration being named 'Debug'?
It's not based on the configuration name, it depends on the DEBUG preprocessor macro being set to 1. This is set up automatically if you use the default Debug target, but you can add it manually in build settings if you're using custom targets.
Awesome, thank you so much Nick!
@chrisbianca Can you verify? Let's close this issue if that works.
It is not using the DEBUG macro based on what I've observed. If you even just change the configuration name from Debug to something else, it will stop working. Change it back to Debug, and it works again. Cloning the Debug configuration, which includes the macros also does not work.
Agree with @mikeygee - his findings match what I identified in https://github.com/facebook/react-native/issues/6011. There's more detail of the different things I tried (and failed) to get this working there.
I can assure you that it is using the DEBUG macro - you can see the code that references it inside RCTDefines.h.
I suspect the issue is that the Debug target in your project is separate from the one in the React framework's subproject.
When they are both named "Debug", Xcode seems to know to set them both, but if you rename the one in your project, I guess that switching to the Debug profile in your project no longer has the effect of toggling the React library itself to Debug mode as well.
I'm not sure how to work around that though.
@nicklockwood Thanks for the tip. I got it working by clicking on the React.xcodeproj in the Libraries directory, and adding a config with the same name as I use in my app project. This makes things much easier, thank you!
@nicklockwood thanks for pointing out the file. This seems resolved. Closing.
@mikeygee can you please tell me which steps you specifically took to resolve this? I got the same problem today without me (knowingly) changing something
@Thorbenandresen Check your scheme settings. The current scheme shows at the top of Xcode. Click on it, then Edit Scheme. Under "Run", make sure the build configuration is set to Debug. If it's set to something different, you won't get the dev menu.
If you want to use a configuration not named "Debug" like me, then it's a little more work to add a config to the React library, but it doesn't sound like you need that.
@mikeygee thanks but that seems fine. I have described my issue here in more detail: http://stackoverflow.com/questions/36413602/cant-open-dev-menu-via-cmdd-or-reload-via-cmdr-any-longer