Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Maaaartin committed Oct 10, 2024
1 parent 0df57a0 commit 9c8cef8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,14 +1314,16 @@ 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<string> {
return this.execInternal([cmd].flat());
}

/**
* Executes a given command on specific device via adb console interface.
* Analogous to `adb -s <serial> <command>`.
* Analogous to `adb -s <serial> <command>`.
* 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<string> {
return this.execInternal(['-s', serial].concat(cmd));
Expand Down
3 changes: 3 additions & 0 deletions src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
return this.client.execDevice(this.id, cmd);
}
Expand Down

0 comments on commit 9c8cef8

Please sign in to comment.