Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewWiFiDriver error #9

Open
ilaer opened this issue Mar 17, 2022 · 2 comments
Open

NewWiFiDriver error #9

ilaer opened this issue Mar 17, 2022 · 2 comments

Comments

@ilaer
Copy link

ilaer commented Mar 17, 2022

adb tcpip后,用adb connect 成功.
D:\GoP\snippet_go>adb connect 192.168.51.202:6000
already connected to 192.168.51.202:6000

但用guia2.NewWiFiDriver("192.168.51.202", "6000")连接报错如下:
2022/03/17 08:47:06 guia2.NewDriver error : Post "http://192.168.51.202:6000/wd/hub/session": EOF

请帮忙看看是什么问题.

@ilaer
Copy link
Author

ilaer commented Mar 17, 2022

已经安装了那两个apk,
运行了命令
adb -s 192.168.51.202:6000 shell "nohup am instrument -w io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner >/sdcard/uia2server.log 2>&1 &"

手动命令行ok
D:\GoP\snippet_go>adb -s 192.168.51.202:6000 shell getprop ro.product.brand
Xiaomi

@electricbubble
Copy link
Owner

electricbubble commented Mar 17, 2022

NewWiFiDriver 的第二参数, 是 uia2 的服务端口,

默认情况下完全不需要指定

func TestNewWiFiDriver(t *testing.T) {
	driver, err := NewWiFiDriver("192.168.51.202")
	if err != nil {
		t.Fatal(err)
	}

	_, err = driver.ActiveAppActivity()
	if err != nil {
		t.Fatal(err)
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants