{"record":{"id":"3c3830a80034692e","repo":"microsoft/playwright","slug":"device-is-closed-3c3830","errorCode":null,"errorMessage":"Device is closed","messagePattern":"Device is closed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/android/backendAdb.ts","lineNumber":60,"sourceCode":"  private _closed = false;\n\n  constructor(serial: string, status: string, host?: string, port?: number) {\n    this.serial = serial;\n    this.status = status;\n    this.host = host;\n    this.port = port;\n  }\n\n  async init() {\n  }\n\n  async close() {\n    this._closed = true;\n  }\n\n  runCommand(command: string): Promise<Buffer> {\n    if (this._closed)\n      throw new Error('Device is closed');\n    return runCommand(command, this.host, this.port, this.serial);\n  }\n\n  async open(command: string): Promise<SocketBackend> {\n    if (this._closed)\n      throw new Error('Device is closed');\n    const result = await open(command, this.host, this.port, this.serial);\n    result.becomeSocket();\n    return result;\n  }\n}\n\nasync function runCommand(command: string, host: string = '127.0.0.1', port: number = 5037, serial?: string): Promise<Buffer> {\n  debug('pw:adb:runCommand')(command, serial);\n  const socket = new BufferedSocketWrapper(command, net.createConnection({ host, port }));\n  try {\n    if (serial) {\n      await socket.write(encodeMessage(`host:transport:${serial}`));","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/android/backendAdb.ts#L42-L78","documentation":"Error \"Device is closed\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/server/android/backendAdb.ts:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}