read
Read file content on the device filesystem.
declare class AdbSync {
read(filename: string): ReadableStream<Uint8Array>;
}
output must be used!
read uses streaming output. If you don't read the output, the command will never finish, and blocking future commands from running.
Example
const content = sync.read("/sdcard/Download/hello.txt");
await content.pipeTo(
new WritableStream({
write(chunk) {
console.log(chunk);
},
}),
);
Equivalent ADB Command
adb pull /sdcard/Download/hello.txt