airtest.core.android.cap_methods.minicap module

retry_when_socket_error(func)[源代码]
class Minicap(adb, projection=None, rotation_watcher=None, display_id=None, ori_function=None)[源代码]

基类:airtest.core.android.cap_methods.base_cap.BaseCap

super fast android screenshot method from stf minicap.

reference https://github.com/openstf/minicap

VERSION = 5
RECVTIMEOUT = None
CMD = 'LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap'
install_or_upgrade()[源代码]

Install or upgrade minicap

返回:None
uninstall()[源代码]

Uninstall minicap

返回:None
install()[源代码]

Install minicap

Reference: https://github.com/openstf/minicap/blob/master/run.sh

返回:None
get_frame(projection=None)[源代码]
Get the single frame from minicap -s, this method slower than get_frames
1. shell cmd 1. remove log info 1.
Args:
projection: screenshot projection, default is None which means using self.projection
Returns:
jpg data
get_stream(lazy=True)[源代码]

Get stream, it uses `adb forward`and socket communication. Use minicap ``lazy``mode (provided by gzmaruijie) for long connections - returns one latest frame from the server

参数:lazy – True or False

Returns:

get_frame_from_stream()[源代码]

Get one frame from minicap stream

返回:frame
snapshot(ensure_orientation=True, projection=None)[源代码]
参数:
  • ensure_orientation – True or False whether to keep the orientation same as display
  • projection – the size of the desired projection, (width, height)

Returns:

update_rotation(rotation)[源代码]

Update rotation and reset the backend stream generator

参数:rotation – rotation input
返回:None
teardown_stream()[源代码]

End the stream

返回:None