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

[dev]实机使用网络 adb 时长宽数值位置反了 #69

Closed
fatinghenji opened this issue Jun 20, 2021 · 22 comments
Closed

[dev]实机使用网络 adb 时长宽数值位置反了 #69

fatinghenji opened this issue Jun 20, 2021 · 22 comments
Labels
bug Something isn't working

Comments

@fatinghenji
Copy link

使用的是真机,网络adb调试,log如下:
auto_derby.zip
问题:在训练页面识别5次第一个训练,没有切换然后就选择了第一个训练方法。
使用模拟器/真机有线链接的方法,查不到adb的端口,显示的都是设备名。

@NateScarlet
Copy link
Owner

duration_ms = max(100, duration_ms) # drag not work if too fast

尝试增大最低拖动时间 似乎拖太快会变成点击

@NateScarlet
Copy link
Owner

这个问题和连接方式应该没关系

@fatinghenji
Copy link
Author

fatinghenji commented Jun 20, 2021

尝试增大最低拖动时间 似乎拖太快会变成点击

是增加max(100, duration_ms) 里面100这个数字吗?我改到了1500依旧存在相同问题。

这个问题和连接方式应该没关系

使用模拟器的时候怎么查看端口号呢?我百度出来的雷电模拟器的端口号是5555,但是在launcher里面输入127.0.0.1:5555之后并不能进一步启动。使用命令行启动返回提示目标计算机积极拒绝

@NateScarlet
Copy link
Owner

NateScarlet commented Jun 20, 2021

那你手动试试用命令行的 adb shell input swipe 0 0 1000 1000 500 看有没有效果 adb 命令行程序需要你自己下 好象你用的那个方舟助手自带了

图片

模拟器一般默认不开adb的 因为用这个端口可以操作你系统文件 需要你自己找设置 蓝叠的是每次随机端口

@fatinghenji
Copy link
Author

那你手动试试用命令行的 adb shell input swipe 0 0 1000 1000 500 看有没有效果

有效果?可以看到屏幕左上方有一个侧行向下的滑动提示。

模拟器一般默认不开adb的 因为用这个端口可以操作你系统文件 需要你自己找设置

image
雷电模拟器是默认勾选的,没有显示adb端口号,百度的结果是默认5555。跑去问雷电客服端口号了,还没回复

@fatinghenji
Copy link
Author

使用adb查询链接设备显示如下

F:\ArknightsAutoHelper\ADB\win32>adb devices
List of devices attached
192.168.123.240:5555    offline # 这个是我开了无线调试的手机
emulator-5554   device # 这个是雷电模拟器

5554端口也尝试了没有用

@NateScarlet
Copy link
Owner

那你增加拖动完的等待试试

time.sleep(0.5)

雷电模拟器我不用所以不知道怎么连

@fatinghenji
Copy link
Author

那你增加拖动完的等待试试

增加到了1.0,没有改善。
训练项目的选择不应该是点按选择吗?为什么会用到滑动命令?

@NateScarlet
Copy link
Owner

在已选中的情况下点按会变成确定训练 滑动不会确定

@Small-Ku
Copy link
Contributor

問題可能是指首5次滑動都在同一個位置?

@NateScarlet
Copy link
Owner

NateScarlet commented Jun 20, 2021

問題可能是指首5次滑動都在同一個位置?

不太可能 我 DMM 和 adb 都测过了

@fatinghenji
Copy link
Author

应该是选择的是哪个界面就会停留在哪个界面并识别5次……太怪了
其他的点击操作都正常。一会我下个蓝叠试试

@NateScarlet
Copy link
Owner

我测不了其他模拟器 因为只有蓝叠支持 hyper-v 然后我用 docker 需要 hyper-v

@NateScarlet
Copy link
Owner

增加了adb 命令的 debug 日志 2216dcc
你看下日志到底用的啥命令

@fatinghenji
Copy link
Author

INFO  [2021-06-20 18:32:25]:auto_derby.template:184: match: tmpl=tmpl<single_mode_training_confirm.png>, pos=(444, 843), similarity=0.96
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=+, current=00000000c001e003e003e007fe7ffffffffffe7fe007e003e003c00100000000, match=000000000000c001e003e003fe1fff7fff7fff7ff007e003e003e00100000000, similarity=0.898
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=4, current=001f801fc01fe01fe01ff01f781e3c1e3e1eff3ffffffffffe7f001e001e001e, match=001e001f801fc01fe01ff01ff01f3c1e3c1e7e3ffefffefffeff003f001e001e, similarity=0.883
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:256: ocr result: +4
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=+, current=0000e000f001f001f001fe0fff1fff3fff3fff1ff001f001f001e00000000000, match=0000e000f001f003f003f003ff3fff7fff3ff807f003f003e001000000000000, similarity=0.844
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=1, current=000e801fe03ff03ff03fc03f803f803f803f803f803f803f803f001f001f0000, match=0018001fe01ff81ff81ff03f003f003f001f000f001f803f803f001f001f0000, similarity=0.844
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=8, current=e007f81f3c3c1e781e383c3cfc1ff81f7c3f1e780ff01ff81f7cfe3ff81fe001, match=e007f81f3c3c1e381e383c3cf81ff81ffc3f1e7c1ff81ff81f7c7e7efc3ff00f, similarity=0.883
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:256: ocr result: +18
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=+, current=00000000c001e003e003e003ff7fffffff7fff3fe003e003e003c00100000000, match=000000000000c001e003e003fe1fff7fff7fff7ff007e003e003e00100000000, similarity=0.898
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:64: match label: value=4, current=001f801fc01fe01ff01ff01f781e3c1e1e1e7f3ffffffffffe7f001e001e001e, match=001e001f801fc01fe01ff01ff01f3c1e3c1e7e3ffefffefffeff003f001e001e, similarity=0.875
DEBUG [2021-06-20 18:32:25]:auto_derby.ocr:256: ocr result: +4
DEBUG [2021-06-20 18:32:25]:auto_derby.clients.adb:111: drag: input swipe 1294 2472 1294 2884 100
DEBUG [2021-06-20 18:32:29]:auto_derby.template:48: screenshot
DEBUG [2021-06-20 18:32:29]:auto_derby.template:125: lightness match: tmpl=tmpl<single_mode_training_confirm.png>, similarity=0.986
INFO  [2021-06-20 18:32:29]:auto_derby.template:184: match: tmpl=tmpl<single_mode_training_confirm.png>, pos=(444, 843), similarity=0.96
DEBUG [2021-06-20 18:32:29]:auto_derby.template:125: lightness match: tmpl=tmpl<single_mode_training_confirm.png>, similarity=0.986
INFO  [2021-06-20 18:32:29]:auto_derby.template:184: match: tmpl=tmpl<single_mode_training_confirm.png>, pos=(444, 843), similarity=0.96
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=+, current=00000000c001e003e003e007fe7ffffffffffe7fe007e003e003c00100000000, match=000000000000c001e003e003fe1fff7fff7fff7ff007e003e003e00100000000, similarity=0.898
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=4, current=001f801fc01fe01fe01ff01f781e3c1e3e1eff3ffffffffffe7f001e001e001e, match=001e001f801fc01fe01ff01ff01f3c1e3c1e7e3ffefffefffeff003f001e001e, similarity=0.883
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:256: ocr result: +4
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:150: ocr result is empty
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=+, current=0000e000f001f001f001fe0fff1fff3fff3fff1ff001f001f001e00000000000, match=0000e000f001f003f003f003ff3fff7fff3ff807f003f003e001000000000000, similarity=0.844
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=1, current=000e801fe03ff03ff03fc03f803f803f803f803f803f803f803f001f001f0000, match=0018001fe01ff81ff81ff03f003f003f001f000f001f803f803f001f001f0000, similarity=0.844
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=8, current=e007f81f3c3c1e781e383c3cfc1ff81f7c3f1e780ff01ff81f7cfe3ff81fe001, match=e007f81f3c3c1e381e383c3cf81ff81ffc3f1e7c1ff81ff81f7c7e7efc3ff00f, similarity=0.883
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:256: ocr result: +18
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=+, current=00000000c001e003e003e003ff7fffffff7fff3fe003e003e003c00100000000, match=000000000000c001e003e003fe1fff7fff7fff7ff007e003e003e00100000000, similarity=0.898
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:64: match label: value=4, current=001f801fc01fe01ff01ff01f781e3c1e1e1e7f3ffffffffffe7f001e001e001e, match=001e001f801fc01fe01ff01ff01f3c1e3c1e7e3ffefffefffeff003f001e001e, similarity=0.875
DEBUG [2021-06-20 18:32:29]:auto_derby.ocr:256: ocr result: +4
DEBUG [2021-06-20 18:32:29]:auto_derby.clients.adb:111: drag: input swipe 1656 2472 1656 2884 100

日志如上
我对比了下
adb shell input swipe 0 0 1000 1000 500adb shell input swipe 1656 2472 1656 2884 100两个命令,前者有滑动痕迹,后者没有

@NateScarlet
Copy link
Owner

为啥坐标会有2472这么大 我看你的屏幕应该是 1920x1080 的
应该是处理缩放的时候有问题 它在屏幕外面滑了

@NateScarlet
Copy link
Owner

我好像知道问题了 你的分辨率识别成 1920x1080 但是实际应该是 1080x1920

NateScarlet added a commit that referenced this issue Jun 20, 2021
@NateScarlet
Copy link
Owner

试一下这个 3a9a880

模拟器返回的长宽是根据当前朝向的 但是实机可能不一样

@fatinghenji
Copy link
Author

最新版问题解决了。期待master的推送

@NateScarlet
Copy link
Owner

我等DMM和adb都育成一局没问题再放到master

@NateScarlet NateScarlet added the bug Something isn't working label Jun 20, 2021
@NateScarlet NateScarlet changed the title [dev]使用网络adb出现的问题 [dev]实机使用网络 adb 时长宽数值位置反了 Jun 20, 2021
@fatinghenji
Copy link
Author

fatinghenji commented Jun 20, 2021

报告一个新bug
在选择比赛的时候滑动事件会变成点击事件。log如下:
auto_derby.log
手动adb执行adb shell input swipe 232 1391 232 1353 200同样为点击,应该不是触摸时间或者延迟的问题吧。
感觉依旧是超出了屏幕的最大值

@fatinghenji fatinghenji reopened this Jun 20, 2021
@NateScarlet
Copy link
Owner

每个bug 一个 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants