airtest.core.android.minicap module

class Minicap(adb, projection=None)[source]

Bases: object

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(inst, *args, **kwargs)[source]

Install or upgrade minicap

Returns:None
uninstall()[source]

Uninstall minicap

Returns:None
install()[source]

Install minicap

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

Returns:None
get_display_info(inst, *args, **kwargs)[source]

Get display info by minicap

Warning

It might segfault, the preferred way is to get the information from adb commands

Returns:display information
get_frame(inst, *args, **kwargs)[source]
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(inst, *args, **kwargs)[source]

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

Parameters:lazy – True or False

Returns:

get_frame_from_stream()[source]

Get one frame from minicap stream

Returns:frame
update_rotation(rotation)[source]

Update rotation and reset the backend stream generator

Parameters:rotation – rotation input
Returns:None
teardown_stream()[source]

End the stream

Returns:None