Skip to main content

Automated Testing Tools for Android and iOS.

Project description

EvaDevice

PyPI PyPI - Downloads

EvaDevice is Automated Testing Tools for Android and iOS.

Environment Config

System Windows Mac Linux
iOS iTunes + wda wda libimobiledevice + wda
Android adb adb adb

Ubuntu install libimobiledevice

sudo add-apt-repository ppa:pmcenery/ppa
sudo apt-get update
sudo apt-get install libimobiledevice-utils
sudo service usbmuxd start

Example Usage

from evadevice import d, EvaDevice


# Serial for target device, e.g. serialno for Android, udid for iOS.
eva_device = EvaDevice(serial, airtest=True)

# Return device list, e.g. {'android': ['xxxxxx'], 'ios': ['xxxxxx-xxxxxx']}.
d.device_list()

# callback demo.
def callback(device):
    if device["status"] == 0:
        print(f"[{device['serial']}] 已离线")
    elif device['status'] == 1:
        print(f"[{device['serial']}] 已上线")

# Start watch device.
d.start_watch_device(callback)

# device info.
eva_device.device_info()

# app list.
eva_device.app_list()

# app start.
eva_device.app_start(pkg_name)

# app stop.
eva_device.app_stop(pkg_name)

# app current.
eva_device.app_current()

# Install apk or ipa.
eva_device.app_install("demo.apk")                     # use local path.
eva_device.app_install("http://example.com/demo.apk")  # install from url.
eva_device.app_install("demo.ipa")                     # use local path.
eva_device.app_install("http://example.com/demo.ipa")  # install from url.

# Uninstall apk or ipa.
eva_device.app_uninstall(pkg_name)

# Push dir and files.
eva_device.push(src, dst, bundle_id/None)  # bundle_id for iOS, None for Android.

# Pull dir and files.
eva_device.pull(src, dst, bundle_id/None)  # bundle_id for iOS, None for Android.

# auto_confirm_thread.
# default text_pattern = "完成|关闭|好|好的|确定|确认|安装|继续安装|下次再说|暂不删除|允许|以后都允许|知道了" Android.
# default text_pattern = "信任|安装|确定|允许|以后|以后都允许|稍后|稍后提醒我|不再提醒|取消|否"              iOS.
eva_device.start_auto_confirm(text_pattern)
eva_device.stop_auto_confirm(text_pattern)

# Return screen info.
eva_device.screen_info()

# Unlock Screen for Android.
eva_device.unlock_screen(password)

# Perform keyevent on the device.
eva_device.key_event(key_code)

# Type a given text.
eva_device.input_text(text, enter=True)

# ocr
eva_device.find_by_ocr(text)
eva_device.click_by_ocr(text)

# fast airtest.
eva_device.airtest_template(path_or_url)
eva_device.airtest_fast_wait(path_or_url)
eva_device.airtest_fast_click(path_or_url)

# more airtest.
# e.g. evaDevice.airtest_wait(template).
# e.g. evaDevice.airtest_touch(pos).
eva_device.airtest_{airtest.core.api.*}(*args, **kwargs)  # 反射所有airtest.core.api方法.

Installing EvaDevice

EvaDevice is available on PyPI:

$ python -m pip install evadevice

LICENSE

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

evadevice-0.1.2-py3-none-any.whl (12.4 MB view details)

Uploaded Python 3

File details

Details for the file evadevice-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: evadevice-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for evadevice-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f325adc8e46d77f9ecc426197e4328482a99b6a240a9501d98ad7f19b3d414b
MD5 ba70fc12cdb128faec3d3ed81df2adab
BLAKE2b-256 c0fdb9050c82e361551392dbe6d40c7b684b3bdd4f611388d7fa57644e84fe55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page