UrielCh/adbkit

Scrcpy.start() does not resolve

Closed this issue · 9 comments

Hi, I was trying to use the Scrcpy class you implemented but the start method does not resolve. The execution gets stuck. Here is a snippet of my current code:

const snippet = async () => {
	const devices = await client.listDevices();
	if (devices.length == 0) {
		return
	}

	const device = devices[0].getClient()
	const scrcpy = device.scrcpy({})
	console.log("Starting")
	await scrcpy.start()
	console.log("Started")
}

It never reaches the last console.log

Please try to use a debugger to find where the code gets stuck.

I can not reproduce this issue.
At least provide your android version

The code gets stuck at this line. Here is a screenshot of the this.scrcpyServer object:

image

Here is some info about my tests:

  • @u4/adbkit version: 4.1.10
  • Android versions: 10, 11, 12
  • Platform Tools: Android Debug Bridge version 1.0.41 / Version 28.0.2-debian

Can you provide a snippet of code that works for you?

I got it working using the ancient solution: revert back to a previous version. I tried many different versions and the results are the following:

  • version < 4.1.3: It works
  • 4.1.3 <= version < 4.1.8: Throws the error AdbFailError: Failure: 'closed' lastMessage:host:transport:3da00e49
  • version >= 4.1.8: It gets stuck

check the file named: tasks/realTest.ts it contains working test code for most functions.

I confirm that the result is the same also with the code you provided in tasks/realTest.ts. If I don't revert back to 4.1.2 or previous it does not work.

I have exactly the same issue as thelicato: it works only with version 4.1.2 and previous. I also have adb version 1.0.41, maybe that's the problem: what is your adb version?

I'm not working on remote-droid, a REST connector for adbkit,
and his front-end, currently I'm only using minicap jpeg to display the device; after that, I will switch back to video mode and then fix that issue. Keep the old version for now. This project is currently pretty active.

If you have already integrated adbkit video stream in a browser, and you can help, I can debug that next week.

just tested, and just fixed it.
v4.1.11

Great, thanks!