Skip to content

TypeError: client.shell is not a function @u4/adbkit #11

Description

@tiennguyen12g

Hello everyone, i get this error : "TypeError: client.shell is not a function". Here is my node server:
const express = require('express');
const { Readable } = require('stream');
const Adb = require('@u4/adbkit');

const app = express();
const client = Adb.createClient();

app.get("/",(req, res) => {
res.sendFile(__dirname + "/test.html");
});

app.get('/video', async (req, res) => {
const stream = client.shell('scrcpy -s R9HT10HL56R --no-display', 'device');
Adb.Utils.readAll(stream).then(output => {
const readable = new Readable();
readable.push(output);
readable.push(null);
res.set('Content-Type', 'video/mp4');
readable.pipe(res);
}).catch(err => {
console.error(err);
res.status(500).send('Error streaming video');
});
});
app.listen(3000, () => {
console.log('Server listening on port 8000');
});

If you have faced with this issue, please give a solution. Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions