From 5debb4cae8ae0f1c9f326096179e6f4e2090a030 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 2 Aug 2023 07:56:17 -0700 Subject: [PATCH] Troubleshoot by killing debugging bridge Summary: Add an option to kill the debugging bridge directly within Flipper. Reviewed By: antonk52 Differential Revision: D47990786 fbshipit-source-id: 30cd8ca1d55e8b2ade03700d884e5d849a2dadbf --- .../src/chrome/ConnectivityLogs.tsx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui-core/src/chrome/ConnectivityLogs.tsx b/desktop/flipper-ui-core/src/chrome/ConnectivityLogs.tsx index 64ef3071676..b3598d82703 100644 --- a/desktop/flipper-ui-core/src/chrome/ConnectivityLogs.tsx +++ b/desktop/flipper-ui-core/src/chrome/ConnectivityLogs.tsx @@ -22,9 +22,12 @@ import {CloseCircleFilled, DeleteOutlined} from '@ant-design/icons'; import { CommandRecordEntry, ConnectionRecordEntry, + DeviceOS, FlipperServer, + FlipperServerCommands, } from 'flipper-common'; import {Button} from 'antd'; +import {getRenderHostInstance} from 'flipper-frontend-core'; const SIDEBAR_WIDTH = 400; @@ -149,6 +152,35 @@ function isShellCommand( return 'cmd' in entry; } +function KillDebuggingBridge({os}: {os: DeviceOS}) { + const { + title, + cmd, + }: { + title: string; + cmd: keyof FlipperServerCommands; + } = + os === 'iOS' + ? {title: 'Kill idb', cmd: 'ios-idb-kill'} + : {title: 'Kill adb server', cmd: 'android-adb-kill'}; + + return ( + <> +

+ Sometimes the error can be resolved by killing the {os} debugging + bridge. +

+ + + ); +} + function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) { const content: JSX.Element[] = []; @@ -168,7 +200,8 @@ function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) { {selection.stderr} , - {selection.troubleshoot} +

{selection.troubleshoot}

+ {!selection.success && }
, ); }