-
Notifications
You must be signed in to change notification settings - Fork 852
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
remove handle_adb_error for droidcast.py #3170
base: dev
Are you sure you want to change the base?
Conversation
remove adb check condition for droidcast
需要判断你遇到的异常并处理,同时 其他异常处理必须按照原样进行,否则这个PR不会被接受 |
好了 |
异常在 Connection.adb_forward() 和 Connection.adb_reverse() 内捕获,看你是在 adb.forward_list() 上有问题还是 adb.forward() AzurLaneAutoScript/module/device/connection.py Lines 419 to 455 in fa0182a
|
在adb.forward()上面有问题,forward_list是空的。local其实是没有的因为这个时候找不到adb device,但是直接用会直接报个adberror()的错误。没有报adberror(device xxx not found)可能是因为没有用到adb_shell()来调用forward。 |
这样就会报adberror(device xxx not found)了 |
好像用adb_shell 来调用forward会连不上,还是回调吧 |
类似于#1167,Mac在待机后过一段时间就找不到adb了,需要用adb_reconnect来找
但当使用droidcast作为截图方法的时候,driodcast会直接用本地缓存的数据来create forward,但此时由于adb找不到device,所以会直接报adberror(),然后进去retry,然后由于具体的error为空字符串,这时候AzurLaneAutoScript/module/device/method/utils.py中的handle_adb_error(e)会直接break,但是其实这时候直接adb_reconnect就可以修复,所以我直接把droidcast中的handle_adb_error直接去掉了,这样不管碰到怎么样的adb_error都会尝试进行adb_reconnect。
坏处是这样的话droidcast中的retry_wrapper会和其他地方的retry_wrapper不一样,还有一种方案是直接把AzurLaneAutoScript/module/device/method/utils.py中的handle_adb_error的else改成return true,这样的话也是无论碰到什么adb_error都会尝试adb_reconnect。