• 看看仓库里有没有 macacaclient 的 jar 包

  • 是横线,不是下划线,名称已经更正,谢谢提出

  • 安装 wda 不用这个,是直接 xcodebuild 安装的,安装卸载测试 APP 用这个,这个是 macaca 依赖的,也可以提前安装好,不用 macaca 指令安装

  • 都需要的,你知道代替的方案么

  • 谢谢夸奖☺

  • 我司的测试机器是不允许越狱的😂 ,而且大部分机器都是 10 了。这个方案自己测着玩行,不适合公司层面使用

  • 已更新二维码

  • 没有成功安装 wda 吧,这个 id 不需要改
    这个属于如何配置 wda,很多帖子说的很详细

  • 必须手机越狱么
    现在越狱的手机很少了吧

  • 这些都是依赖的工具

    说下我明确知道的吧,都是在使用过程中遇到问题或者疑问,自己查询资料得到的

    有误,更新

    ideviceinstaller 是单独的一个项目,不是在 libimobiledevice 工具套件里面的

    libimobiledevice

    在 windows 上大家可以使用 iTunes 来与 iPhone 进行通信,但是 Linux 上没有这类的官方软件,所以一些爱好者就破解了 iTunes 的通信协议,然后在 Linux 上实现了该协议,也就是 libimobiledevice

    可以到官网去看详细的介绍 http://www.libimobiledevice.org/
    很多 ios 助手应该是依赖这个的。

    简单说是可以操作 ios 手机的命令行工具,iTunes 上实现的功能,通过命令行也可实现。

    mac 上安装了之后有很多命令行工具。这是一个工具套,从名称大概能知道是做什么,不明确的直接加 -h 查看帮助,很简单。

    本项目用到了 ideviceinstaller idevicesyslog idevicedebug(这个是打开 app 用的) ,后期打算结合 idevicescreenshot 和 idevicecrashreport 自动分析 crash 日志。

    -rwxr-xr-x    1 root  admin      9804  3  8 12:51 idevice_id
    -rwxr-xr-x    1 root  admin     43316  3  8 12:51 idevicebackup
    -rwxr-xr-x    1 root  admin     57448  3  8 12:51 idevicebackup2
    -rwxr-xr-x    1 root  admin     27952  3  8 12:51 idevicecrashreport
    -rwxr-xr-x    1 root  admin     14552  3  8 12:51 idevicedate
    -rwxr-xr-x    1 root  admin     16292  3  8 12:51 idevicedebug
    -rwxr-xr-x    1 root  admin     23196  3  8 12:51 idevicedebugserverproxy
    -rwxr-xr-x    1 root  admin     14976  3  8 12:51 idevicediagnostics
    -rwxr-xr-x    1 root  admin      9376  3  8 12:51 ideviceenterrecovery
    -rwxr-xr-x    1 root  admin     28404  3  8 12:51 ideviceimagemounter
    -rwxr-xr-x    1 root  admin     22244  3  8 12:51 ideviceinfo
    lrwxr-xr-x    1 MAC   admin        55  7 21  2016 ideviceinstaller -> ../Cellar/ideviceinstaller/1.1.0_2/bin/ideviceinstaller
    -rwxr-xr-x    1 root  admin      9828  3  8 12:51 idevicename
    -rwxr-xr-x    1 root  admin     14772  3  8 12:51 idevicenotificationproxy
    -rwxr-xr-x    1 root  admin     31988  3  8 12:51 idevicepair
    -rwxr-xr-x    1 root  admin     27604  3  8 12:51 ideviceprovision
    -rwxr-xr-x    1 root  admin     14464  3  8 12:51 idevicescreenshot
    -rwxr-xr-x    1 root  admin     14880  3  8 12:51 idevicesyslog```
    
    

    包括上面的 ideviceinstaller,这个是命令行安装卸载 app 用的 ideviceinstaller 是单独安装的,原文中已经说明

    devicescreenshots 截屏的,idevicesyslog 查看系统日志的,idevicecrashreport 是获取 crash 日志的。还有备份,恢复手机系统的等等。

    具体的使用方式查看帮助

    MACdeMacBook-Pro:iosMonkey-master MAC$ ideviceinstaller -h
    Usage: ideviceinstaller OPTIONS
    Manage apps on iOS devices.
      -u, --udid UDID   Target specific device by its 40-digit device UDID.
      -l, --list-apps   List apps, possible options:
           -o list_user - list user apps only (this is the default)
           -o list_system   - list system apps only
           -o list_all  - list all types of apps
           -o xml       - print full output as xml plist
      -i, --install ARCHIVE Install app from package file specified by ARCHIVE.
                            ARCHIVE can also be a .ipcc file for carrier bundles.
      -U, --uninstall APPID Uninstall app specified by APPID.
      -g, --upgrade ARCHIVE Upgrade app from package file specified by ARCHIVE.
      -L, --list-archives   List archived applications, possible options:
           -o xml       - print full output as xml plist
      -a, --archive APPID   Archive app specified by APPID, possible options:
           -o uninstall - uninstall the package after making an archive
           -o app_only  - archive application data only
           -o docs_only - archive documents (user data) only
           -o copy=PATH - copy the app archive to directory PATH when done
           -o remove    - only valid when copy=PATH is used: remove after copy
      -r, --restore APPID   Restore archived app specified by APPID
      -R, --remove-archive APPID  Remove app archive specified by APPID
      -o, --options     Pass additional options to the specified command.
      -h, --help        prints usage information
      -d, --debug       enable communication debugging
    

    usbmuxd

    是 USB 和 ios 手机通信的工具,USB 通信代替 WIFI
    webdriveragent 项目中有明确说明
    https://github.com/facebook/WebDriverAgent/wiki/Common-Issues
    截图:

    iproxy 详细介绍:

    http://iphonedevwiki.net/index.php/SSH_Over_USB

    macaca 使用 iproxy 的帖子:

    Macaca iOS 驱动调整为 USB 通信 https://testerhome.com/topics/6314

  • 太激动了,感谢

  • 已加二维码☺ ☺ ☺

  • 已改。非原创。只是优化

  • @xdf
    Macaca 又多一个应用场景

    @Lihuazhang
    看了你的 SwiftMonkey。感觉很强大,但是不熟悉 ios 相关语言😁

  • 我这边三台设备执行 case 正常,每个设备初始化加了 5s 等待。

  • 那应该是传值未生效,macaca-ios.js 你是怎么修改的,覆盖,还是手写改的?

  • 目前替换我修改的 macaca-ios.js

    传值和 udid 一样,应该可以实现

  • 延迟多加一些,20s,我没这么多设备试验

    Macaca 团队之前说也会开发自己的替换掉 wda,不知道什么进度了@xdf

  • 两台设备我也看见很多这种错误
    启动了 wda 没有正常关闭,必然出现 test failed ,然后会重新启动。
    上面的错误在见过,原因未知。
    第二个错误是 Linux 返回的,进程相关的

  • 不能真的并行,每个设备隔几秒试试,先不让报错
    我觉得多个设备间隔 1 秒触发,还是能接受的

  • 挨个备注很给力啊,分析了不少源码,但是要是升级的话,就有点麻烦

    我改的脚本,上面有地址,两台真机试了很多次,都能够成功并行执行。
    能成功,说明端口传递正常了。有时会失败,这个要看具体的日志。

  • 我用 java,appium 的 java-client 有接口,直接调用就行了

    // 当前上下文
        public String getContext() {
            return driver.getContext();
        }
    
    // 设置上下文
        public void context(String name) {
            driver.context(name);
        }
    
  • 默认是不能传这个参数的,不改 macaca-ios.js 的逻辑,传了这个参数也不会使用,还是默认的 8900

    看看改的 macaca-ios.js 大概就知道了。

  • 还是等待了 2s

  • 早前加过别的,这个已经加进去了