feat(adb): add partial support for ADB server version 40

This commit is contained in:
Simon Chan 2024-12-30 16:40:23 +08:00
parent fba7533d78
commit ab98953b69
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
9 changed files with 396 additions and 187 deletions

View file

@ -4,7 +4,7 @@
import "source-map-support/register.js";
import { Adb, AdbServerClient } from "@yume-chan/adb";
import { Adb, AdbServerClient, Ref } from "@yume-chan/adb";
import { AdbServerNodeTcpConnector } from "@yume-chan/adb-server-node-tcp";
import { WritableStream } from "@yume-chan/stream-extra";
import { program } from "commander";
@ -132,6 +132,8 @@ createDeviceCommand("shell [args...]")
)
.configureHelp({ showGlobalOptions: true })
.action(async (args: string[], options: DeviceCommandOptions) => {
const ref = new Ref();
const adb = await createAdb(options);
const shell = await adb.subprocess.shell(args);
@ -169,6 +171,8 @@ createDeviceCommand("shell [args...]")
process.exit(1);
},
);
ref.unref();
});
createDeviceCommand("logcat [args...]")