Skip to content

Commit

Permalink
feat: restartUsbMuxd...
Browse files Browse the repository at this point in the history
  • Loading branch information
yowpark committed Nov 15, 2023
1 parent befa3fa commit bfbe7c1
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class IosDriver implements DeviceDriver {
private constructor(private readonly deviceServerService: DeviceServerService) {}

static async create(deviceServerService: DeviceServerService): Promise<IosDriver> {
await IosDriver.restartUsbMuxd();
await IosDriver.clearIdaClones();
await XcodeBuild.validateXcodeBuild();

Expand Down Expand Up @@ -154,4 +155,17 @@ export class IosDriver implements DeviceDriver {
}
await fs.promises.mkdir(idaRunspacesPath, { recursive: true });
}

// not work
private static async restartUsbMuxd(): Promise<void> {
logger.info('Restarting usbmuxd');
const ret = await ChildProcess.exec('launchctl stop com.apple.usbmuxd', {}).catch(() => {
logger.warn('Failed to stop usbmuxd');
});
logger.info('stop usbmuxd done', { ret });
const ret2 = await ChildProcess.exec('launchctl start com.apple.usbmuxd', {}).catch(() => {
logger.warn('Failed to start usbmuxd');
});
logger.info('start usbmuxd done', { ret2 });
}
}

0 comments on commit bfbe7c1

Please sign in to comment.