Skip to content

Commit

Permalink
Adjust for new simserver CLI, update simserver submodule (#561)
Browse files Browse the repository at this point in the history
This PR changes the commands that are sent to simserver to comply with
new format.
  • Loading branch information
balins authored Sep 19, 2024
1 parent 13cb9ce commit 08ddf03
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/simulator-server
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class AndroidEmulatorDevice extends DeviceBase {
}

makePreview(): Preview {
return new Preview(["android", this.serial!]);
return new Preview(["android", "--id", this.serial!]);
}

async sendBiometricAuthorization(isMatch: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export class IosSimulatorDevice extends DeviceBase {
}

makePreview(): Preview {
return new Preview(["ios", this.deviceUDID, getOrCreateDeviceSet()]);
return new Preview(["ios", "--id", this.deviceUDID, "--device-set", getOrCreateDeviceSet()]);
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/vscode-extension/src/devices/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ export class Preview implements Disposable {
}

public sendTouches(touches: Array<TouchPoint>, type: "Up" | "Move" | "Down") {
const touchesCoords = touches.map((pt) => `${pt.xRatio} ${pt.yRatio}`).join(" ");
this.subprocess?.stdin?.write(`touch${type} ${touchesCoords}\n`);
const touchesCoords = touches.map((pt) => `${pt.xRatio},${pt.yRatio}`).join(" ");
this.subprocess?.stdin?.write(`touch ${type} ${touchesCoords}\n`);
}

public sendKey(keyCode: number, direction: "Up" | "Down") {
this.subprocess?.stdin?.write(`key${direction} ${keyCode}\n`);
this.subprocess?.stdin?.write(`key ${direction} ${keyCode}\n`);
}

public sendPaste(text: string) {
Expand Down

0 comments on commit 08ddf03

Please sign in to comment.