Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remote debugging from dev menu #36754

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 1 addition & 39 deletions packages/react-native/React/CoreModules/RCTDevMenu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -284,46 +284,8 @@ - (void)setDefaultJSBundle
withBundleURL:bundleManager.bundleURL
withErrorMessage:@"Failed to open Flipper. Please check that Metro is running."];
}]];
} else if (devSettings.isRemoteDebuggingAvailable) {
#else
if (devSettings.isRemoteDebuggingAvailable) {
#endif
// 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.
[items addObject:[RCTDevMenuItem
buttonItemWithTitleBlock:^NSString * {
return devSettings.isDebuggingRemotely ? @"Stop Debugging" : @"Debug with Chrome";
}
handler:^{
devSettings.isDebuggingRemotely = !devSettings.isDebuggingRemotely;
}]];
} else {
// If neither are available, we're defaulting to a message that tells you about remote debugging.
[items
addObject:[RCTDevMenuItem
buttonItemWithTitle:@"Debugger Unavailable"
handler:^{
NSString *message = RCTTurboModuleEnabled()
? @"Debugging with Chrome is not supported when TurboModules are enabled."
: @"Include the RCTWebSocket library to enable JavaScript debugging.";
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:@"Debugger Unavailable"
message:message
preferredStyle:UIAlertControllerStyleAlert];
__weak __typeof__(alertController) weakAlertController = alertController;
[alertController
addAction:[UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(__unused UIAlertAction *action) {
[weakAlertController
dismissViewControllerAnimated:YES
completion:nil];
}]];
[RCTPresentedViewController() presentViewController:alertController
animated:YES
completion:NULL];
}]];
}
#endif
}

[items addObject:[RCTDevMenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,6 @@ public void onOptionSelected() {
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();
}
});
}
}

public DevLoadingViewManager getDevLoadingViewManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
<string name="catalyst_open_flipper_error" project="catalyst" translatable="false">Failed to open Flipper. Please check that Metro is running.</string>
<string name="catalyst_devtools_open" project="catalyst" translatable="false">Open React DevTools</string>
<string name="catalyst_debug_open" project="catalyst" translatable="false">Open Debugger</string>
<string name="catalyst_debug" project="catalyst" translatable="false">Debug</string>
<string name="catalyst_debug_stop" project="catalyst" translatable="false">Stop Debugging</string>
<string name="catalyst_debug_connecting" project="catalyst" translatable="false">Connecting to debugger...</string>
<string name="catalyst_debug_error" project="catalyst" translatable="false">Failed to connect to debugger!</string>
<string name="catalyst_debug_chrome" project="catalyst" translatable="false">Debug with Chrome</string>
<string name="catalyst_debug_chrome_stop" project="catalyst" translatable="false">Stop Chrome Debugging</string>
<string name="catalyst_hot_reloading" project="catalyst" translatable="false">Enable Fast Refresh</string>
<string name="catalyst_hot_reloading_stop" project="catalyst" translatable="false">Disable Fast Refresh</string>
<string name="catalyst_hot_reloading_auto_disable" project="catalyst" translatable="false">Disabling Fast Refresh because it requires a development bundle.</string>
Expand Down