Appium iOS 每次运行 Appium 时都需要信任 WebDriverAgentRunner 吗?

问题描述 投票:0回答:2

所以我有一个免费的开发者帐户,我不确定这是否有什么区别。但现在,每次我在 iPhone 上的设备管理设置中为 WebDriverAgentRunner-Runner 执行 Appium 时,我都必须相信自己是一名开发人员。有没有办法解决?也许这就是免费和付费开发者会员资格之间的区别?

谢谢你。

ios xcode appium appium-ios xcuitest
2个回答
0
投票

您能分享一下您每次收到的弹窗截图吗? 一旦你从 XCode 选择你的设备,使用有效的证书对其进行签名并在你的 iPhone 上构建应该会帮助你。请按照以下步骤操作

  1. 右键单击 Appium Server GUI > 内容 > 资源 > 应用程序 > node_modules > appium > node_modules > Appium-webdriver 代理
  2. 检查 WebDriverAgent.XCodeProj
  3. 在XCode中打开WebDriverAgent.XCodeProj
  4. 如果项目未打开,请单击右上角的文件夹图标。 单击 WebDriverAgent
  5. 在中心面板 > 目标中选择 WebDriverAgentRunner
  6. 单击“签名和功能”
  7. 单击“团队”下拉菜单以登录您的应用程序
  8. 您可以选择现有证书或新证书,您必须有苹果证书
  9. 在顶部找到 WebDriverAgent 项目。
  10. 从下拉列表中选择 WebDriverAgentRunner
  11. 从下拉列表中选择要执行测试用例的目标设备
  12. 点击“产品”菜单
  13. 点击“测试”
  14. 它将在您的目标设备上安装 WebDriverAgent
  15. 现在您可以尝试从 Appium Inspector 启动新会话

如果这没有解决您的问题,请安装具有您正在使用的相同证书的其他应用程序。在测试目标应用程序之前,请勿将其从手机中删除。即使您结束会话,它也会将您的证书保留在手机中


0
投票

如果您使用免费的开发者帐户,请尝试遵循下面给出的完整手动配置步骤。

  1. 将您的 Apple ID 添加到 XCode 并下载证书

  2. 找到WebDriverAgent项目, 这里我给出了 Appium CLI 和 Appium Desktop 的路径,您可以使用任一路径来配置 wda。 在终端中,执行命令:

    $ where appium or which Appium
    /path/where/installed/bin/appium
    
    Eg: WebDriverAgent project path for
    Appium CLI:
    /path/where/installed/lib/node_modules/appium/node_modules/appium-webdriveragent
    Appium Desktop:
    /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent
    
    
  3. 导航到终端中的 WebDriverAgent 项目路径并运行以下命令来设置项目

    mkdir -p Resources/WebDriverAgent.bundle
        ./Scripts/bootstrap.sh -d
    
    
  4. 在 Xcode 中打开 WebDriverAgent.xcodeproj。对于 WebDriverAgentLib 和 WebDriverAgentRunner 目标,请在“常规”选项卡中选择“自动管理签名”,然后选择您的开发团队。这也应该自动选择签名证书。

  5. 进入“Build Settings”选项卡,将“Product Bundle Identifier”从 com.facebook.WebDriverAgentRunner 更改为 Xcode 会接受的东西(非常独特的东西!)

  6. 构建项目的命令:

    xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test
    
    
  7. 以上命令应在设备的给定 UDID 上安装 WDA。现在手动去设置并信任WDA

  8. 现在尝试使用allowProvisioningUpdates标志再次构建项目:

    xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test -allowProvisioningUpdates
    
    
  9. 使用指向 CLI 服务器的 Appium Inspector 与应用程序创建会话

© www.soinside.com 2019 - 2024. All rights reserved.