Skip to content

Latest commit

 

History

History
129 lines (101 loc) · 3.54 KB

README_EN.md

File metadata and controls

129 lines (101 loc) · 3.54 KB

tidevice

tidevice

PyPI PyPI - Downloads

中文文档

Command line tool to communicate with iOS device, support the following functions

  • screenshot
  • get device info
  • ipa install and uninstall
  • launch and kill app
  • list installed app info
  • retrieve performance data
  • simulate run xctest, eg: WebDriverAgent
  • other

Support platform: Mac, Linux, Windows

Install

pip3 install -U tidevice

Usage

Show version number

$ tidevice version
0.1.0

List connected devices

$ tidevice list
List of apple devices attached
00008030-001A35E40212345678 codeskyblue的iPhoneSE

$ tidevice list --json
[
    {
        "udid": "00008030-001A35E40212345678",
        "name": "codeskyblue的iPhoneSE"
    }
]

App management

$ tidevice install example.ipa
$ tidevice install https://example.org/example.ipa

$ tidevice uninstall com.example.demo

$ tidevice launch com.example.demo

$ tidevice kill com.example.demo

# show installed app list
$ tidevice applist

Run WebDriverAgent

Please make sure your iPhone already have WebDriverAgent installed

$ tidevice xctest -B com.facebook.wda.WebDriverAgent.Runner
[I 210127 11:40:23 _device:909] BundleID: com.facebook.wda.WebDriverAgent.Runner
[I 210127 11:40:23 _device:911] DeviceIdentifier: 12345678901234567890abcdefg
[I 210127 11:40:23 _device:773] SignIdentity: 'Apple Development: -Your-Developer-Name-'
[I 210127 11:40:23 _device:840] Launch 'com.facebook.wda.WebDriverAgent.Runner' pid: 239
[I 210127 11:40:23 _device:1003] ProductVersion: 12.4
[I 210127 11:40:24 _device:952] Start execute test plan with IDE version: 29
[I 210127 11:40:24 _device:875] WebDriverAgent start successfully

# Change WDA listen port to 8200
$ tidevice xctest -B com.facebook.wda.WebDriverAgent.Runner -e USB_PORT:8200

Then you can connect with Appium or facebook-wda

facebook-wda example code

import wda
c = wda.USBClient()
print(c.info)

Mount DeveloperDiskImage

# Find in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
# If not found, download from https://github.com/iGhibli/iOS-DeviceSupport
$ tidevice developer
[I 210127 11:37:52 _device:518] ProductVersion: 12.4
[I 210127 11:37:52 _imagemounter:81] Pushing DeveloperDiskImage.dmg
[I 210127 11:37:52 _imagemounter:94] Push complete
[I 210127 11:37:53 _device:589] DeveloperImage mounted successfully

Other

# reboot device
$ tidevice reboot

$ tidevice screenshot screenshot.jpg

# TODO(ssx): collect performance
# $ tidevice perf -o fps,mem,cpu -B com.example.demo

DEVELOP

See DEVELOP

Thanks

LICENSE

MIT