diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java index b5a326c6d64..e9994ef138b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java @@ -107,6 +107,22 @@ public final class BridgeDevSupportManager extends DevSupportManagerBase { toggleJSSamplingProfiler(); } }); + + if (!getDevSettings().isDeviceDebugEnabled()) { + // For remote debugging, we open up Chrome running the app in a web worker. + // Note that this requires async communication, which will not work for Turbo Modules. + addCustomDevOption( + getDevSettings().isRemoteJSDebugEnabled() + ? applicationContext.getString(com.facebook.react.R.string.catalyst_debug_stop) + : applicationContext.getString(com.facebook.react.R.string.catalyst_debug), + new DevOptionHandler() { + @Override + public void onOptionSelected() { + getDevSettings().setRemoteJSDebugEnabled(!getDevSettings().isRemoteJSDebugEnabled()); + handleReloadJS(); + } + }); + } } @Override diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index fc7f45e4855..120a181a463 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -396,6 +396,7 @@ public abstract class DevSupportManagerBase implements DevSupportManager { handleReloadJS(); } }); + if (mDevSettings.isDeviceDebugEnabled()) { // For on-device debugging we link out to Flipper. // Since we're assuming Flipper is available, also include the DevTools. @@ -428,21 +429,8 @@ public abstract class DevSupportManagerBase implements DevSupportManager { mApplicationContext.getString(R.string.catalyst_open_flipper_error)); } }); - } else { - // For remote debugging, we open up Chrome running the app in a web worker. - // Note that this requires async communication, which will not work for Turbo Modules. - options.put( - mDevSettings.isRemoteJSDebugEnabled() - ? mApplicationContext.getString(R.string.catalyst_debug_stop) - : mApplicationContext.getString(R.string.catalyst_debug), - new DevOptionHandler() { - @Override - public void onOptionSelected() { - mDevSettings.setRemoteJSDebugEnabled(!mDevSettings.isRemoteJSDebugEnabled()); - handleReloadJS(); - } - }); } + options.put( mApplicationContext.getString(R.string.catalyst_change_bundle_location), new DevOptionHandler() { @@ -478,6 +466,7 @@ public abstract class DevSupportManagerBase implements DevSupportManager { bundleLocationDialog.show(); } }); + options.put( // NOTE: `isElementInspectorEnabled` is not guaranteed to be accurate. mApplicationContext.getString(R.string.catalyst_inspector),