tidevice can be used to communicate with iPhone device

Overview

tidevice

tidevice

PyPI PyPI - Downloads

English

该工具能够用于与iOS设备进行通信, 提供以下功能

  • 截图
  • 获取手机信息
  • ipa包的安装和卸载
  • 根据bundleID 启动和停止应用
  • 列出安装应用信息
  • 模拟Xcode运行XCTest,常用的如启动WebDriverAgent测试(此方法不依赖xcodebuild)
  • 获取指定应用性能(CPU,MEM,FPS)
  • 其他

支持运行在Mac,Linux,Windows上

安装

Python 3.6+

pip3 install -U "tidevice[openssl]"   # Recommend

如果上面的命令提示安装失败,就试试下面的命令。(不过这种方法安装,配对功能就没有了,因为没有办法进行签名)

pip3 install -U tidevice

使用

查看版本号

$ tidevice version
0.1.0

列出连接设备

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

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

应用管理

# 安装应用
$ tidevice install example.ipa

# 指定设备安装
$ tidevice --udid $UDID install https://example.org/example.ipa

# 卸载应用
$ tidevice uninstall com.example.demo

# 启动应用
$ tidevice launch com.example.demo

# 停止应用
$ tidevice kill com.example.demo

# 查看已安装应用
$ tidevice applist

Run XCTest

请先确保手机上已经安装有WebDriverAgent应用

# 运行XCTEST
$ 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

# 修改监听端口为8200, 并显示调试日志
$ tidevice xctest -B com.facebook.wda.WebDriverAgent.Runner -e USB_PORT:8200 --debug

Relay

# 转发请求到手机,类似于iproxy
$ tidevice relay 8100 8100

# 转发并把传输的内容用hexdump的方法print出来
$ tidevice relay -x 8100 8100

运行WebDriverAgent

目前已知的几个问题

wdaproxy这个命令会同时调用xctest和relay,另外当wda退出时,会自动重新启动xctest

# 运行 XCTest 并在PC上监听8200端口转发到手机8100服务
$ tidevice wdaproxy -B com.facebook.wda.WebDriverAgent.Runner --port 8200
...logs...

启动后你就可以使用Appium 或者 facebook-wda 来运行iOS自动化了

facebook-wda example code

import wda
c = wda.Client("http://localhost:8200")
print(c.info)

运行XCTest UITest

这个不是Unit Tests,而是UITests。具体可以看这里的解释说明 https://fbidb.io/docs/test-execution

以这个项目为例: https://github.com/FeiHuang93/XCTest-Demo 应用分为执行测试的应用 testXCTestUITests 和 被测应用 testXCTest

执行方法

$ tidevice xctest --bundle-id philhuang.testXCTestUITests.xctrunner --target-bundle-id philhuang.testXCTest
# ... 省略一部分不重要的信息 ...
[I 210301 15:37:07 _device:887] logProcess: 2021-03-01 15:37:07.924620+0800 testXCTestUITests-Runner[81644:13765443] Running tests...
[I 210301 15:37:07 _device:984] Test runner ready detected
[I 210301 15:37:07 _device:976] Start execute test plan with IDE version: 29
[I 210301 15:37:07 _device:887] logProcess: Test Suite 'All tests' started at 2021-03-01 15:37:08.009
    XCTestOutputBarrier
[I 210301 15:37:07 _device:887] logProcess: Test Suite 'testXCTestUITests.xctest' started at 2021-03-01 15:37:08.010
    XCTestOutputBarrierTest Suite 'testXCTestUITests' started at 2021-03-01 15:37:08.010
[I 210301 15:37:07 _device:887] logProcess: XCTestOutputBarrier
[I 210301 15:37:07 _device:887] logProcess: Test Case '-[testXCTestUITests testExample]' started.
    XCTestOutputBarrier
[I 210301 15:37:07 _device:887] logProcess:     t =     0.00s Start Test at 2021-03-01 15:37:08.010
[I 210301 15:37:07 _device:887] logProcess:     t =     0.00s Set Up
[I 210301 15:37:07 _device:887] logProcess: 2021-03-01 15:37:08.010828+0800 testXCTestUITests-Runner[81644:13765443] testExample start
[I 210301 15:37:07 _device:887] logProcess:     t =     0.00s     Open philhuang.testXCTest
[I 210301 15:37:07 _device:887] logProcess:     t =     0.00s         Launch philhuang.testXCTest
[I 210301 15:37:08 _device:887] logProcess:     t =     0.04s             Wait for accessibility to load
[I 210301 15:37:08 _device:887] logProcess:     t =     0.04s             Setting up automation session
[I 210301 15:37:08 _device:887] logProcess:     t =     0.10s             Wait for philhuang.testXCTest to idle
[I 210301 15:37:09 _device:887] logProcess:     t =     1.13s Tear Down
[I 210301 15:37:09 _device:887] logProcess: Test Case '-[testXCTestUITests testExample]' passed (1.337 seconds).
[I 210301 15:37:09 _device:887] logProcess: XCTestOutputBarrier
[I 210301 15:37:09 _device:887] logProcess: Test Suite 'testXCTestUITests' passed at 2021-03-01 15:37:09.349.
    	 Executed 1 test, with 0 failures (0 unexpected) in 1.337 (1.339) seconds
    XCTestOutputBarrier
[I 210301 15:37:09 _device:887] logProcess: Test Suite 'testXCTestUITests.xctest' passed at 2021-03-01 15:37:09.350.
    	 Executed 1 test, with 0 failures (0 unexpected) in 1.337 (1.340) seconds
[I 210301 15:37:09 _device:887] logProcess: XCTestOutputBarrier
[I 210301 15:37:09 _device:887] logProcess: Test Suite 'All tests' passed at 2021-03-01 15:37:09.352.
    	 Executed 1 test, with 0 failures (0 unexpected) in 1.337 (1.343) seconds
    XCTestOutputBarrier
[I 210301 15:37:09 _device:887] logProcess: XCTestOutputBarrier
[I 210301 15:37:09 _device:1059] xctrunner quited

挂载开发者镜像

这个步骤其实不太需要,因为如果tidevice的命令需要开发者镜像的时候,会自动去挂载的

# 先在本地路径查找 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
# 如果没有会去网站 https://github.com/iGhibli/iOS-DeviceSupport 下载,下载到路径 ~/.tidevice/device-support/
$ 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

查看设备信息

$ tidevice info

# 查看设备电源信息
$ tidevice info --domain com.apple.mobile.battery --json
{
    "BatteryCurrentCapacity": 53,
    "BatteryIsCharging": true,
    "ExternalChargeCapable": true,
    "ExternalConnected": true,
    "FullyCharged": false,
    "GasGaugeCapability": true,
    "HasBattery": true
}

Known domains are:

com.apple.disk_usage
com.apple.disk_usage.factory
com.apple.mobile.battery
com.apple.iqagent
com.apple.purplebuddy
com.apple.PurpleBuddy
com.apple.mobile.chaperone
com.apple.mobile.third_party_termination
com.apple.mobile.lockdownd
com.apple.mobile.lockdown_cache
com.apple.xcode.developerdomain
com.apple.international
com.apple.mobile.data_sync
com.apple.mobile.tethered_sync
com.apple.mobile.mobile_application_usage
com.apple.mobile.backup
com.apple.mobile.nikita
com.apple.mobile.restriction
com.apple.mobile.user_preferences
com.apple.mobile.sync_data_class
com.apple.mobile.software_behavior
com.apple.mobile.iTunes.SQLMusicLibraryPostProcessCommands
com.apple.mobile.iTunes.accessories
com.apple.mobile.internal
com.apple.mobile.wireless_lockdown
com.apple.fairplay
com.apple.iTunes
com.apple.mobile.iTunes.store
com.apple.mobile.iTunes

其他常用

# 重启
$ tidevice reboot

# 截图
$ tidevice screenshot screenshot.jpg

# 性能采集 (TODO)
# $ tidevice perf -o fps,mem,cpu -B com.example.demo

# 输出日志 same as idevicesyslog
$ tidevice syslog

DEVELOP

See DEVELOP

Thanks

LICENSE

MIT

Comments
  • 求解connect to device error: UsbmuxReplyCode.ConnectionRefused

    求解connect to device error: UsbmuxReplyCode.ConnectionRefused

    wda装好了,连mac 执行iproxy 8100 8100 访问http://localhost:8100/status可以看到手机信息

    但是连windosw,执行tidevice xctest -B com.facebook.wda.WebDriverAgent.Runner -e USB_PORT:8200 提示WebDriverAgent start successfully,然后执行tidevice relay 8100 8100,访问http://localhost:8100/status 报错 handle stream from: ('::1', 59494, 0, 0) connect to device error: UsbmuxReplyCode.ConnectionRefused 请问怎么解呀

    opened by mp55 28
  • iOS15系统,启动wda时,报错

    iOS15系统,启动wda时,报错

    MacBook-Pro:~ $ tidevice xctest -B com.facebook.WebDriverAgentRunner.xctrunner
    [I 211027 10:32:48 _device:996] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
    [I 211027 10:32:48 _device:998] DeviceIdentifier: 9941e2ce2018cd02c295b0108ee30b0c6e64b7f8
    [I 211027 10:32:48 _device:572] ProductVersion: 15.0
    [I 211027 10:32:48 _device:551] Download https://tool.appetizer.io/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/15.0.zip -> /Users/hhh/.tidevice/device-support/15.0.zip
    [I 211027 10:32:49 _device:551] Download https://github.com/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/15.0.zip -> /Users/hhh/.tidevice/device-support/15.0.zip
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 454, in start_service
        return self._unsafe_start_service(name)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 471, in _unsafe_start_service
        "Remember that you have to mount the Developer disk image on your device"
    tidevice.exceptions.MuxServiceError: Could not start service: com.apple.testmanagerd.lockdown.secure! Remember that you have to mount the Developer disk image on your device
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 607, in _request_developer_image_dir
        self._urlretrieve(mirror_url, image_zip_path)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 556, in _urlretrieve
        r.raise_for_status()
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py", line 941, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://tool.appetizer.io/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/15.0.zip
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/bin/tidevice", line 8, in <module>
        sys.exit(main())
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/__main__.py", line 689, in main
        actions[args.subparser](args)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/__main__.py", line 231, in cmd_xctest
        env=env)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 1008, in xctest
        x1 = self._connect_testmanagerd_lockdown()
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 805, in _connect_testmanagerd_lockdown
        LockdownService.TestmanagerdLockdownSecure)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 456, in start_service
        self.mount_developer_image()
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 648, in mount_developer_image
        with self._request_developer_image_dir() as _dir: #, signature_path:
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
        return next(self.gen)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 611, in _request_developer_image_dir
        self._urlretrieve(origin_url, image_zip_path)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tidevice/_device.py", line 556, in _urlretrieve
        r.raise_for_status()
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py", line 941, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/15.0.zip
    

    看提示好像是镜像链接的问题

    opened by lycfr 9
  • tidevice.exceptions.MuxReplyError: UsbmuxReplyCode.ConnectionRefused

    tidevice.exceptions.MuxReplyError: UsbmuxReplyCode.ConnectionRefused

    完整的报错如下,我和之前哪位老友一样,也是用着用着就这样了,啥都没干..就是突然怎么启动都启动不了服务了,到处没找到答案 希望能够解答一下 Traceback (most recent call last): File "d:\users\y7000\anaconda3\lib\runpy.py", line 194, in run_module_as_main return run_code(code, main_globals, None, File "d:\users\y7000\anaconda3\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "d:\Users\y7000\anaconda3\Scripts\tidevice.exe_main.py", line 7, in File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_main.py", line 742, in main actionsargs.subparser File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_main.py", line 237, in cmd_xctest d.xctest(args.bundle_id, File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_device.py", line 973, in xctest x1 = self._connect_testmanagerd_lockdown() File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_device.py", line 769, in _connect_testmanagerd_lockdown conn = self.start_service(LockdownService.TestmanagerdLockdown) File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_device.py", line 447, in start_service return self._unsafe_start_service(name) File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_device.py", line 476, in _unsafe_start_service conn = self.create_inner_connection(data['Port'], _ssl=_ssl) File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_device.py", line 287, in create_inner_connection self._usbmux._check(data) File "d:\users\y7000\anaconda3\lib\site-packages\tidevice_usbmux.py", line 94, in _check raise MuxReplyError(data['Number']) tidevice.exceptions.MuxReplyError: UsbmuxReplyCode.ConnectionRefused

    opened by luxiaolan6373 9
  • tidevice.exceptions.MuxError: socket unix:/var/run/usbmuxd unable to connect

    tidevice.exceptions.MuxError: socket unix:/var/run/usbmuxd unable to connect

    在 Ubuntu 上执行 tidevice list 会报异常

    系统:5.4.0-60-generic #67~18.04.1-Ubuntu 具体日志: List of apple devices attached Traceback (most recent call last): File "/root/.pyenv/versions/3.8.0/bin/tidevice", line 10, in sys.exit(main()) File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/main.py", line 407, in main actionsargs.subparser File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/main.py", line 81, in cmd_list for dinfo in um.device_list(): File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/_usbmux.py", line 72, in device_list data = self.send_recv(payload) File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/_usbmux.py", line 45, in send_recv with self.create_connection() as s: File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/_usbmux.py", line 42, in create_connection return PlistSocket(self.__address, self._next_tag()) File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/_safe_socket.py", line 89, in init super().init(addr) File "/root/.pyenv/versions/3.8.0/lib/python3.8/site-packages/tidevice/_safe_socket.py", line 44, in init raise MuxError("socket unix:{} unable to connect".format(addr)) tidevice.exceptions.MuxError: socket unix:/var/run/usbmuxd unable to connect

    help wanted 
    opened by li8911255 9
  • 执行xctest报错超时退出

    执行xctest报错超时退出

    环境:Windows 10 设备:iPhone 12(15.4) Python版本:3.9.1 tidevice版本:0.7.6 执行命令:tidevice xctest -B com.xxx.xctrunner 报错内容

    C:\Users\user>tidevice xctest -B com.xxx.xctrunner
    [I 220412 10:54:58 _device:977] ProductVersion: 15.4
    [I 220412 10:54:58 _device:824] CFBundleExecutable: FastbotRunner-Runner
    [I 220412 10:54:59 _device:855] AppContainer: /private/var/mobile/Containers/Data/Application/EDB662B5-A0FF-40CF-8156-6C14B9F66D2F
    [I 220412 10:54:59 _device:895] Launch 'com.xxx.xctrunner' pid: 45661
    [I 220412 10:54:59 _device:1028] Test runner ready detected
    [I 220412 10:54:59 _device:1020] Start execute test plan with IDE version: 29
    [E 220412 10:56:59 _instruments:573] drain error
        Traceback (most recent call last):
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 563, in _drain
            self._drain_single_message()
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 586, in _drain_single_message
            mheader, payload = self.recv_dtx_message()
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 480, in recv_dtx_message
            data = self.psock.recvall(0x20)
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_safe_socket.py", line 88, in recvall
            chunk = self._sock.recv(size - len(buf))
          File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1226, in recv
            return self.read(buflen)
          File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1101, in read
            return self._sslobj.read(len)
        socket.timeout: The read operation timed out
    [I 220412 10:56:59 _device:1100] xctrunner quited
    

    补充内容:

    [D 220412 11:17:18 _instruments:597] DTXMessage: expects_reply:1 flags:2 ('_XCT_logDebugMessage:', ['11:17:17.925 FastbotRunner-Runner[381:9484] Returning result XCTWaiterResultCompleted for waiter <XCTWaiter: 0x281a290a0, state: XCTWaiterStateFinished>\n'])
    [E 220412 11:17:18 _instruments:573] drain error
        Traceback (most recent call last):
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 563, in _drain
            self._drain_single_message()
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 586, in _drain_single_message
            mheader, payload = self.recv_dtx_message()
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_instruments.py", line 480, in recv_dtx_message
            data = self.psock.recvall(0x20)
          File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\tidevice\_safe_socket.py", line 88, in recvall
            chunk = self._sock.recv(size - len(buf))
          File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1226, in recv
            return self.read(buflen)
          File "c:\users\user\appdata\local\programs\python\python39\lib\ssl.py", line 1101, in read
            return self._sslobj.read(len)
        socket.timeout: The read operation timed out
    [D 220412 11:17:18 _instruments:575] dtxm socket closed
    [I 220412 11:17:18 _device:1100] xctrunner quited
    
    opened by jongyu 8
  • pip install tidevice and prompts

    pip install tidevice and prompts "command not found: tidevice"

    Hello, after the installation, view the version "tidevice version" prompts "command not found: tidevice", is there something wrong with the configuration? Thanks very much!

    opened by cssshuang 8
  • wda重签名后运行tidevice xctest 报错 socket connection broken

    wda重签名后运行tidevice xctest 报错 socket connection broken

    python3.6&3.8 mac 10.15.5 log:

    [I 210201 21:10:10 _device:912] BundleID: com.xxxxxxxxxx.WebDriverAgentRunner-Runner
    [I 210201 21:10:10 _device:914] DeviceIdentifier: 00008030-xxxxxxxxxxxxE
    [I 210201 21:10:10 _device:775] SignIdentity: 'iPhone Distribution: xxxxxxxxx Co., Ltd.'
    Traceback (most recent call last):
      File "/Users/xx/.pyenv/versions/uiauto8/bin/tidevice", line 8, in <module>
        sys.exit(main())
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/__main__.py", line 429, in main
        actions[args.subparser](args)
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/__main__.py", line 209, in cmd_xctest
        d.xctest(args.bundle_id, logger=setup_logger(level=logging.INFO), env=env)
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/_device.py", line 985, in xctest
        pid = self._launch_wda(bundle_id, session_identifier, env=env, logger=logger)
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/_device.py", line 786, in _launch_wda
        for fname in fsync.listdir("/tmp"):
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/_sync.py", line 106, in listdir
        pkg = self._recv()
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/_sync.py", line 77, in _recv
        buf = buf + self.recvall(FHeader.size - len(buf))
      File "/Users/xx/.pyenv/versions/3.8.6/envs/uiauto8/lib/python3.8/site-packages/tidevice/_safe_socket.py", line 55, in recvall
        raise MuxError("socket connection broken")
    tidevice.exceptions.MuxError: socket connection broken
    
    opened by carrypink 8
  • 多设备使用relay代理给Appium跑自动化会出现xctrunner quited

    多设备使用relay代理给Appium跑自动化会出现xctrunner quited

    报错信息

    Exception in thread Thread-2:
    Traceback (most recent call last):
      File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    [W 210203 13:54:59 _device:1042] xctrunner quited
    

    启动代理的代码tidevice -u ${udid} relay ${extendPort} 8100 有在Appium中有设置webDriverAgentUrl

    opened by jongyu 7
  • 找不到iOS14.4.zip文件

    找不到iOS14.4.zip文件

    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://tool.appetizer.io/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/14.4.zip requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/14.4.zip 自动webdriverrunner时报找不到文件,下载地址里面没有对应文件,但是里面的iOS14文件名包含其他的内容,我感觉你们时没有测iOS14的设备? https://tool.appetizer.io/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport

    opened by jongyu 7
  • IOS14.0以上手机使用tidevice fsync 查看应用数据目录报错:tidevice.exceptions.MuxError: socket connection broken

    IOS14.0以上手机使用tidevice fsync 查看应用数据目录报错:tidevice.exceptions.MuxError: socket connection broken

    cmd中运行命令:python37 -m tidevice fsync ls /Documents/PayLoad -B com.ksg.tako python版本:3.7.9 tidevice版本:0.4.8 ios版本: 14.0 报错堆栈如下: Traceback (most recent call last): File "E:\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "E:\Python\Python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\Python\Python37\lib\site-packages\tidevice\__main__.py", line 694, in <module> main() File "E:\Python\Python37\lib\site-packages\tidevice\__main__.py", line 689, in main actions[args.subparser](args) File "E:\Python\Python37\lib\site-packages\tidevice\__main__.py", line 384, in cmd_fsync pprint(sync.listdir(arg0)) File "E:\Python\Python37\lib\site-packages\tidevice\_sync.py", line 106, in listdir pkg = self._recv() File "E:\Python\Python37\lib\site-packages\tidevice\_sync.py", line 75, in _recv self.recvall(plist_size) # Discard plist xml-content File "E:\Python\Python37\lib\site-packages\tidevice\_safe_socket.py", line 61, in recvall raise MuxError("socket connection broken") tidevice.exceptions.MuxError: socket connection broken

    opened by byteslrl 6
  • 运行tidevice list报错

    运行tidevice list报错

    Microsoft Windows [版本 10.0.19041.928] (c) Microsoft Corporation。保留所有权利。

    C:\Users\D1M>tidevice list List of apple devices attached Traceback (most recent call last): File "d:\python\lib\runpy.py", line 198, in run_module_as_main "main", mod_spec) File "d:\python\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "D:\python\Scripts\tidevice.exe_main.py", line 7, in File "d:\python\lib\site-packages\tidevice_main.py", line 687, in main actionsargs.subparser File "d:\python\lib\site-packages\tidevice_main_.py", line 82, in cmd_list for dinfo in um.device_list(): File "d:\python\lib\site-packages\tidevice_usbmux.py", line 75, in device_list data = self.send_recv(payload) File "d:\python\lib\site-packages\tidevice_usbmux.py", line 46, in send_recv with self.create_connection() as s: File "d:\python\lib\site-packages\tidevice_usbmux.py", line 43, in create_connection return PlistSocket(self.__address, self._next_tag()) File "d:\python\lib\site-packages\tidevice_safe_socket.py", line 95, in init super().init(addr) File "d:\python\lib\site-packages\tidevice_safe_socket.py", line 48, in init self._sock.connect(addr) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

    opened by a805791737 6
  • iOS 15.7、iOS 16 及以上版本无法使用部分命令 报错InvalidService 、ImageMountFailed

    iOS 15.7、iOS 16 及以上版本无法使用部分命令 报错InvalidService 、ImageMountFailed

    [email protected] ~ % tidevice screenshot screenshot.jpg Screenshot saved to screenshot.jpg [I 221227 17:01:28 _device:602] ProductVersion: 16.0.3 [I 221227 17:01:28 _imagemounter:157] Pushing DeveloperDiskImage.dmg [I 221227 17:01:28 _imagemounter:170] Push complete Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 484, in start_service return self._unsafe_start_service(name) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 503, in _unsafe_start_service raise MuxServiceError(error) tidevice.exceptions.MuxServiceError: InvalidService

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/bin/tidevice", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/main.py", line 965, in main actionsargs.subparser File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/main.py", line 274, in cmd_screenshot d.screenshot().convert("RGB").save(filename) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 528, in screenshot return next(self.iter_screenshot()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 533, in iter_screenshot conn = self.start_service(LockdownService.MobileScreenshotr) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 486, in start_service self.mount_developer_image() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_device.py", line 663, in mount_developer_image self.imagemounter.mount(image_path, signature_path) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_imagemounter.py", line 139, in mount return self.mount_fileobj(image_reader, image_size, signature_content) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_imagemounter.py", line 182, in mount_fileobj self._check_error(ret) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tidevice/_imagemounter.py", line 123, in _check_error raise MuxError(ret['Error']) tidevice.exceptions.MuxError: ImageMountFailed

    help wanted 
    opened by Vantermonde 1
  • 【0.9.12】 执行 tidevice ps 指令报错

    【0.9.12】 执行 tidevice ps 指令报错

    我们希望App一直处于启动状态,所以定时在检查App的运行状态tidevice ps。 每天都会出现批量报错。报错信息统计看基本每个设备每天都会出现2次报错。 怀疑过是设备连接过多造成的,之前链接18台设备,后来改到7台设备。但是还是会出现。

    报错信息1 运行中app,指令执行出现异常内容:Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/tidevice", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/main.py", line 742, in main actionsargs.subparser File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/main.py", line 452, in cmd_ps ps = list(d.instruments.app_process_list(app_infos)) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 708, in app_process_list processes = self.app_running_processes() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 681, in app_running_processes retobj = self.call_message(identifier, "runningProcesses") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 354, in call_message channel = self.make_channel(channel) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 315, in make_channel result = self.call_message(0, '_requestChannelWithCode:identifier:', aux) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 356, in call_message _id = self.send_dtx_message(channel, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 392, in send_dtx_message self.sendall(data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_safe_socket.py", line 66, in sendall return self._sock.sendall(data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1204, in sendall v = self.send(byte_view[count:]) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1173, in send return self._sslobj.write(data)ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2485)

    报错信息2 运行中app,指令执行出现异常内容:[E 221206 14:44:41 _instruments:594] drain error Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 580, in _drain self._drain_single_message() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 607, in _drain_single_message mheader, payload = self.recv_dtx_message() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 513, in recv_dtx_message message_id = self.recv_part_dtx_message() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 409, in recv_part_dtx_message data = self.psock.recvall(0x20) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_safe_socket.py", line 115, in recvall raise ConnectionError("socket connection broken") ConnectionError: socket connection brokenTraceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/tidevice", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/main.py", line 965, in main actionsargs.subparser File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/main.py", line 582, in cmd_ps ps = list(ts.app_process_list(app_infos)) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 737, in app_process_list processes = self.app_running_processes() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 708, in app_running_processes retobj = self.call_message(identifier, "runningProcesses") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 357, in call_message channel = self.make_channel(channel) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 318, in make_channel result = self.call_message(0, '_requestChannelWithCode:identifier:', aux) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 363, in call_message return self.wait_reply(_id).result File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tidevice/_instruments.py", line 568, in wait_reply raise ConnectionError("connection closed")ConnectionError: connection closed

    opened by wwwwsy 1
  • 实现类似adbkit的能力

    实现类似adbkit的能力

    目前iPhone设备比较昂贵,如果公司出现多个办公点,以目前的情况来说,则需要购买多个设备来进行开发和测试。是否可以在iPhone和Pc间加上一个代理服务,使得iPhone设备可以远程被用于xcode调试。

    目前我了解到可以模拟lockdown来进行模拟iPhone设备链接usbmuxd,如果我在这个模拟的lockdown提供服务,允许客户端链接这个代理服务,是否就可以完成代理能力实现跨物理设备连接和使用iPhone设备

    opened by zhangpeibisha 1
  • tidevice 启动 wda 失败

    tidevice 启动 wda 失败

    报错日志如下:

    [I 221107 19:40:17 init:245] WDA is not running, exec: /Library/Frameworks/Python.framework/Versions/3.10/bin/tidevice xctest [I 221107 19:40:18 _device:966] BundleID: com.facebook.WebDriverAgentRunner.xctrunner.xctrunner [I 221107 19:40:18 _device:982] ProductVersion: 15.7.1 [I 221107 19:40:18 _device:983] DeviceIdentifier: 00008110-001645A63698401E [I 221107 19:40:18 _device:819] SignIdentity: 'Apple Development: Chenxi Li (V6N3HHBYZS)' [I 221107 19:40:18 _device:825] CFBundleExecutable: WebDriverAgentRunner-Runner [I 221107 19:40:18 _device:856] AppContainer: /private/var/mobile/Containers/Data/Application/A9314134-F89A-4AEE-AC60-4E8E4F8C7508 [I 221107 19:40:18 _device:896] Launch 'com.facebook.WebDriverAgentRunner.xctrunner.xctrunner' pid: 53700 [I 221107 19:40:18 _device:1032] Test runner ready detected [I 221107 19:40:18 _device:1024] Start execute test plan with IDE version: 29 [E 221107 19:40:18 _instruments:594] drain error Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tidevice/_instruments.py", line 580, in _drain self._drain_single_message() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tidevice/_instruments.py", line 607, in _drain_single_message mheader, payload = self.recv_dtx_message() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tidevice/_instruments.py", line 513, in recv_dtx_message message_id = self.recv_part_dtx_message() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tidevice/_instruments.py", line 409, in recv_part_dtx_message data = self.psock.recvall(0x20) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tidevice/_safe_socket.py", line 113, in recvall raise ConnectionError("socket connection broken") ConnectionError: socket connection broken [I 221107 19:40:18 _device:1104] xctrunner quited [W 221107 19:40:18 _device:923] WebDriverAgentRunner quitted [W 221107 19:40:20 init:255] xctest launch failed

    想问一下编译 wda 对 MacOS 和 XCode 版本有要求吗? 手机ios 版本:15.7 MacOS:12.6 XCode:13.2

    p.s. 顺便问一下,之前git工程里那个打包好的ipa文件删掉了吗?

    opened by bqwwdsh 1
  • 能更新一个iPhone14系统及iPhoneSE3的MODELS信息吗

    能更新一个iPhone14系统及iPhoneSE3的MODELS信息吗

    "iPhone14,6": "iPhone SE3",
    "iPhone14,7": "iPhone 14",
    "iPhone14,8": "iPhone 14 Plus",
    "iPhone15,2": "iPhone 14 Pro",
    "iPhone15,3": "iPhone 14 Pro Max",
    
    opened by lycfr 0
Releases(0.3.1)
Owner
Alibaba
Alibaba Open Source
Alibaba
API Rest testing FastAPI + SQLAchmey + Docker

Transactions API Rest Implement and design a simple REST API Description We need to a simple API that allow us to register users' transactions and hav

TxeMac 2 Jun 30, 2022
Automatic SQL injection and database takeover tool

sqlmap sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of

sqlmapproject 25.7k Jan 04, 2023
ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

Mustafa 1 Jul 11, 2022
The (Python-based) mining software required for the Game Boy mining project.

ntgbtminer - Game Boy edition This is a version of ntgbtminer that works with the Game Boy bitcoin miner. ntgbtminer ntgbtminer is a no thrills getblo

Ghidra Ninja 31 Nov 04, 2022
pytest plugin for testing mypy types, stubs, and plugins

pytest plugin for testing mypy types, stubs, and plugins Installation This package is available on PyPI pip install pytest-mypy-plugins and conda-forg

TypedDjango 74 Dec 31, 2022
🐍 Material for PyData Global 2021 Presentation: Effective Testing for Machine Learning Projects

Effective Testing for Machine Learning Projects Code for PyData Global 2021 Presentation by @edublancas. Slides available here. The project is develop

Eduardo Blancas 73 Nov 06, 2022
A wrapper for webdriver that is a jumping off point for web automation.

Webdriver Automation Plus ===================================== Description: Tests the user can save messages then find them in search and Saved items

1 Nov 08, 2021
Show, Edit and Tell: A Framework for Editing Image Captions, CVPR 2020

Show, Edit and Tell: A Framework for Editing Image Captions | arXiv This contains the source code for Show, Edit and Tell: A Framework for Editing Ima

Fawaz Sammani 76 Nov 25, 2022
Declarative HTTP Testing for Python and anything else

Gabbi Release Notes Gabbi is a tool for running HTTP tests where requests and responses are represented in a declarative YAML-based form. The simplest

Chris Dent 139 Sep 21, 2022
Test for generating stylized circuit traces from images

I test of an image processing idea to take an image and make neat circuit board art automatically. Inspired by this twitter post by @JackRhysider

Miller Hooks 3 Dec 12, 2022
HTTP load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom

hey is a tiny program that sends some load to a web application. hey was originally called boom and was influenced from Tarek Ziade's tool at tarekzia

Jaana Dogan 14.9k Jan 07, 2023
Active Directory Penetration Testing methods with simulations

AD penetration Testing Project By Ruben Enkaoua - GL4Di4T0R Based on the TCM PEH course (Heath Adams) Index 1 - Setting Up the Lab Intallation of a Wi

GL4DI4T0R 3 Aug 12, 2021
自动化爬取并自动测试所有swagger-ui.html显示的接口

swagger-hack 在测试中偶尔会碰到swagger泄露 常见的泄露如图: 有的泄露接口特别多,每一个都手动去试根本试不过来 于是用python写了个脚本自动爬取所有接口,配置好传参发包访问 原理是首先抓取http://url/swagger-resources 获取到有哪些标准及对应的文档地

jayus 534 Dec 29, 2022
An improbable web debugger through WebSockets

wdb - Web Debugger Description wdb is a full featured web debugger based on a client-server architecture. The wdb server which is responsible of manag

Kozea 1.6k Dec 09, 2022
Thin-wrapper around the mock package for easier use with pytest

pytest-mock This plugin provides a mocker fixture which is a thin-wrapper around the patching API provided by the mock package: import os class UnixF

pytest-dev 1.5k Jan 05, 2023
FFPuppet is a Python module that automates browser process related tasks to aid in fuzzing

FFPuppet FFPuppet is a Python module that automates browser process related tasks to aid in fuzzing. Happy bug hunting! Are you fuzzing the browser? G

Mozilla Fuzzing Security 24 Oct 25, 2022
Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)

Leon 3.5k Dec 30, 2022
A Demo of Feishu automation testing framework

FeishuAutoTestDemo This is a automation testing framework which use Feishu as an example. Execute runner.py to run. Technology Web UI Test pytest + se

2 Aug 19, 2022
🏃💨 For when you need to fill out feedback in the last minute.

BMSCE Auto Feedback For when you need to fill out feedback in the last minute. 🏃 💨 Setup Clone the repository Run pip install selenium Set the RATIN

Shaan Subbaiah 10 May 23, 2022
User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite

Flask_Restful_SQLAlchemy_server User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite. Backend b

Austin Weigel 1 Nov 17, 2022