airtest.core.ios.ios module

retry_session(func)[源代码]
class IOS(addr='http://localhost:8100/')[源代码]

基类:airtest.core.device.Device

ios client # befor this you have to run WebDriverAgent # xcodebuild -project path/to/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination “id=$(idevice_id -l)” test # iproxy $port 8100 $udid

uuid
session
window_size(*args, **kwargs)[源代码]
orientation
display_info
get_render_resolution()[源代码]

Return render resolution after rotation

返回:offset_x, offset_y, offset_width and offset_height of the display
get_current_resolution()[源代码]
home()[源代码]
snapshot(filename=None, strType=False, ensure_orientation=True)[源代码]

take snapshot filename: save screenshot to filename

touch(*args, **kwargs)[源代码]
double_click(pos)[源代码]
swipe(fpos, tpos, duration=0.5, steps=5, fingers=1)[源代码]
keyevent(keys)[源代码]

just use as home event

text(*args, **kwargs)[源代码]
install_app(uri, package)[源代码]

curl -X POST $JSON_HEADER -d “{“desiredCapabilities”:{“bundleId”:”com.apple.mobilesafari”, “app”:”[host_path]/magicapp.app”}}” $DEVICE_URL/session https://github.com/facebook/WebDriverAgent/wiki/Queries

start_app(package, activity=None)[源代码]
stop_app(package)[源代码]
get_ip_address()[源代码]

get ip address from webDriverAgent

返回:raise if no IP address has been found, otherwise return the IP address
device_status()[源代码]

show status return by webDriverAgent Return dicts of infos