UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

24 lines 760 B
import { AdbPrematureEOFError } from '../../errors.js'; import Command from '../../command.js'; export default class IsInstalledCommand extends Command { async execute(pkg) { await this._send(`shell:pm path ${pkg} 2>/dev/null`); await this.readOKAY(); try { const reply = await this.parser.readAscii(8); switch (reply) { case 'package:': return true; default: throw this.parser.unexpected(reply, "'package:'"); } } catch (err) { if (err instanceof AdbPrematureEOFError) { return false; } throw err; } } } //# sourceMappingURL=isinstalled.js.map