airtest.core.android.cap_methods.minicap module
- class Minicap(adb, projection=None, rotation_watcher=None, display_id=None, ori_function=None)[source]
Bases:
BaseCap
super fast android screenshot method from stf minicap.
reference https://github.com/openstf/minicap
- VERSION = 5
- RECVTIMEOUT = 3
- CMD = 'LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap'
- install()[source]
Install minicap
Reference: https://github.com/openstf/minicap/blob/master/run.sh
- Returns:
None
- get_frame(projection=None)[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(lazy=True)[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:
- snapshot(ensure_orientation=True, projection=None)[source]
- Parameters:
ensure_orientation – True or False whether to keep the orientation same as display
projection – the size of the desired projection, (width, height)
Returns: