diff --git a/README_DOCS.md b/README_DOCS.md index fd0838e4..7840e34b 100644 --- a/README_DOCS.md +++ b/README_DOCS.md @@ -89,3 +89,9 @@ adb.listDevices((devices) => { - `time` option in `touch` method is converted to UTC time. - Tracker `change` event emits the same instance of the device instead of creating a new device object every time. - `install` and `uninstall` commands will fail if any other response than `Success` is received. Until V5 the promise could have resolved even when the operation was not successful. + +## Change log + +### 6.2 + +`exec` methods accept `string[]` as an argument. Fix for https://github.com/Maaaartin/adb-ts/issues/13. diff --git a/src/client.ts b/src/client.ts index 09060828..7226339e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1314,6 +1314,7 @@ export class Client { /** * Executes a given command via adb console interface. + * If cmd contains arguments, they need to be passed as and string[], not string. @see https://github.com/Maaaartin/adb-ts/issues/13 */ public exec(cmd: string | string[]): Promise { return this.execInternal([cmd].flat()); @@ -1321,7 +1322,8 @@ export class Client { /** * Executes a given command on specific device via adb console interface. - * Analogous to `adb -s `. + * Analogous to `adb -s `. + * If cmd contains arguments, they need to be passed as and string[], not string. @see https://github.com/Maaaartin/adb-ts/issues/13 */ public execDevice(serial: string, cmd: string | string[]): Promise { return this.execInternal(['-s', serial].concat(cmd)); diff --git a/src/device.ts b/src/device.ts index f40979e0..b9345f9c 100644 --- a/src/device.ts +++ b/src/device.ts @@ -342,6 +342,9 @@ export class Device implements IDevice { return this.client.killApp(this.id, pkg); } + /** + * If cmd contains arguments, they need to be passed as and string[], not string. @see https://github.com/Maaaartin/adb-ts/issues/13 + */ public exec(cmd: string | string[]): Promise { return this.client.execDevice(this.id, cmd); }