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

红米8aJAVACAP截图不正确 #706

Closed
hgjazhgj opened this issue Mar 16, 2020 · 8 comments
Closed

红米8aJAVACAP截图不正确 #706

hgjazhgj opened this issue Mar 16, 2020 · 8 comments

Comments

@hgjazhgj
Copy link
Contributor

hgjazhgj commented Mar 16, 2020

(重要!问题分类)

  • 图像识别、设备控制相关问题

描述问题bug
JAVACAP在所有横屏应用下返回的图像方向正确但尺寸不正确,就像是把一块横着放的海绵塞进了竖着放的盒子里
JAVACAP返回的图片是经过压缩编码的,这个被编码的图片就是错误的

相关截图
a
Snipaste_2020-03-16_14-48-07

复现步骤
在IDE里显示的就不正确,简化后就是以下代码

from airtest.core.android.android import Android
from airtest.core.android.constant import CAP_METHOD,ORI_METHOD
a=Android(cap_method=CAP_METHOD.JAVACAP,ori_method=ORI_METHOD.ADB)
import cv2
cv2.imshow('',a.snapshot())

预期效果
使用MINICAP会报错,使用ADB能得到正确的截图

python 版本:
python3.7

airtest 版本:
1.1.3

设备:

  • 型号: 红米redmi8a
  • 系统: MIUI(11.0.7)(android 9)

其他相关环境信息
win10 1909,python3.7,airtest1.1.3,adb1.0.40,Android.sdk_version=28

@EraChen233
Copy link
Member

第二张图是ide的截图,第一张图片是什么?

@hgjazhgj
Copy link
Contributor Author

第一张截图是JAVACAP返回值解码后的原图

@EraChen233
Copy link
Member

好的,我们检查一下

@TongbaoYang
Copy link

小米6 也是这种情况

@13ob0
Copy link

13ob0 commented Jun 9, 2020

MIUI的adb截图都是这样。。。

@yimelia
Copy link
Member

yimelia commented Jul 7, 2020

更新至airtest v1.1.4,并且卸载掉手机中 yosemite.apk,重新安装airtest文件夹里的yosemite.apk即可。
或者直接更新到MIUI12,最新的MIUI12可以无需勾选javacap就能使用

@yimelia yimelia closed this as completed Jul 7, 2020
@yimelia
Copy link
Member

yimelia commented Jul 7, 2020

@hgjazhgj
我们只是把图片横竖换了一下而已,没有改动其他地方,闪退可能跟这个问题无关,如果能抓到异常log的话可能会更方便分析问题。
或者简单把MIUI11升级到12,就可以不用勾选javacap截图了,可以试试看先

@hgjazhgj
Copy link
Contributor Author

hgjazhgj commented Jul 7, 2020

不好意思,此问题的原因是airtest自带的adb版本不是最新的起冲突了

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

No branches or pull requests

5 participants