goadb icon indicating copy to clipboard operation
goadb copied to clipboard

ListDevices Error

Open 0xhex opened this issue 5 years ago • 3 comments

Hello,when i launch 3 emulator i received error from ListDevices function while in terminal adb devices command working nice. When i run 2 device there is no like issue Any help about this problem? My code for listing devices

client,err := adb.New()
	if err != nil {
		fmt.Fprintf(os.Stderr, "error New adb: %v\n", err)
		return
	}
	b_devices,err := client.ListDevices()
	if err != nil {
		fmt.Fprintf(os.Stderr, "error ListDevices adb: %v\n", err)
		return
	}

received error message

error ListDevices adb: ParseError: error performing ListDevices on *adb.Adb (&{server:0xc0001320f0})

Screenshot 2019-12-27 16 59 13

@zach-klippenstein

0xhex avatar Dec 27 '19 13:12 0xhex

Hi, @0xhex . I'm recently using goadb, and I found that your reported errror occured because the length of the response was clipped to MaxMessageLength = 255 but each deviceinfo is almost 100-bytes, so this error occured when a deviceinfo was clipped. To solve this, you can change it to MaxMessageLength = 65536 or a bigger value that ensures your deviceinfo can be fully displayed.

Same issue reported in #26 . Mind me sending a pr? @zach-klippenstein

zhongqin0820 avatar Oct 14 '20 15:10 zhongqin0820

Go ahead.

zach-klippenstein avatar Oct 14 '20 20:10 zach-klippenstein

Hi, @0xhex . I'm recently using goadb, and I found that your reported errror occured because the length of the response was clipped to MaxMessageLength = 255 but each deviceinfo is almost 100-bytes, so this error occured when a deviceinfo was clipped. To solve this, you can change it to MaxMessageLength = 65536 or a bigger value that ensures your deviceinfo can be fully displayed.

Same issue reported in #26 . Mind me sending a pr? @zach-klippenstein

Hi @zhongqin0820 I'm stuck on the same problem, I read the source and @zach-klippenstein indicated that the 255 number is following Google adb implementation, any idea on this?

ltpquang avatar Nov 24 '20 07:11 ltpquang