adbkit icon indicating copy to clipboard operation
adbkit copied to clipboard

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

Open tiennguyen12g opened this issue 1 year ago • 7 comments

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.

tiennguyen12g avatar Mar 26 '23 11:03 tiennguyen12g