airtest.core.ios.ios module

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

Bases: airtest.core.device.Device

ios client

  • before 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)[source]
orientation
display_info
get_render_resolution()[source]

Return render resolution after rotation

Returns:offset_x, offset_y, offset_width and offset_height of the display
get_current_resolution()[source]
home()[source]
snapshot(filename=None, strType=False, quality=10)[source]

take snapshot filename: save screenshot to filename quality: The image quality, integer in range [1, 99]

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

just use as home event

text(*args, **kwargs)[source]
install_app(uri, package)[source]

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)[source]
stop_app(package)[source]
get_ip_address()[source]

get ip address from webDriverAgent

Returns:raise if no IP address has been found, otherwise return the IP address
device_status()[source]

show status return by webDriverAgent Return dicts of infos