Move crash reporting listener to the server

Summary: Changelog: Move crash watcher to the server. Add 'device-crash' event. Add 'device-start-crash-watcher', 'device-stop-crash-watcher' commands. Add 'onDeviceCrash' method to Plugin Client.

Reviewed By: mweststrate

Differential Revision: D33089810

fbshipit-source-id: ed62ee7c1129e5e25af18b444744b0796f567b72
This commit is contained in:
Andrey Goncharov
2021-12-20 11:37:25 -08:00
committed by Facebook GitHub Bot
parent 9fd45b96d2
commit 731749b41f
21 changed files with 519 additions and 426 deletions

View File

@@ -20,6 +20,7 @@ import {ERR_PHYSICAL_DEVICE_LOGS_WITHOUT_IDB, IOSBridge} from './IOSBridge';
import split2 from 'split2';
import {ServerDevice} from '../ServerDevice';
import {FlipperServerImpl} from '../../FlipperServerImpl';
import {addFileWatcherForiOSCrashLogs} from './iOSCrashUtils';
type IOSLogLevel = 'Default' | 'Info' | 'Debug' | 'Error' | 'Fault';
@@ -153,6 +154,10 @@ export default class IOSDevice extends ServerDevice {
}
}
protected startCrashWatcherImpl(): () => void {
return addFileWatcherForiOSCrashLogs(this);
}
static getLogLevel(level: string): DeviceLogLevel {
switch (level) {
case 'Default':