【问题标题】:Testing Failed when build using Xcode build command or appium使用 Xcode 构建命令或 appium 构建时测试失败
【发布时间】:2019-04-21 12:26:48
【问题描述】:

我正在使用:

Xcode 10.1
Os Version : 12.1
iPhone 6

我确实按照所有必需的步骤来设置构建和一切,但在尝试使用 xcode build 构建项目时仍然出现错误。

我在签名问题或我缺少一些配置之间感到困惑。在 webdriver 代理 xproj 中。

xcode 构建命令的实际错误

Testing failed:
WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. (Underlying error: Unable to launch com.apple.test.WebDriverAgentRunner-Runner. (Underlying error: The operation couldn’t be completed. (DTXMessage error 1.))))

appium 上的实际错误

Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.

其他一些日志,如果有帮助的话:

2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}
2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=IDETestOperationsObserverErrorDomain Code=4 “Failed to install or launch the test runner” UserInfo={NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/asianweb/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Test-WebDriverAgentRunner-2018.11.19_11-02-01-+0530.xcresult, NSLocalizedDescription=Failed to install or launch the test runner, NSUnderlyingError=0x7f8ec7ac6c70 {Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}}}

其他日志信息

{
deviceSerialNumber: XXXXXXXXXXXX
identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
deviceClass: iPhone
deviceName: qa’s iPhone
deviceIdentifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
productVersion: 12.1
buildVersion: 16B92
deviceSoftwareVersion: 12.1 (16B92)
deviceArchitecture: arm64
deviceTotalCapacity: 11945508864
deviceAvailableCapacity: 5477302272
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsPaired: YES
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <DVTDeviceType:0x8f7ec4d00ca0 Xcode.DeviceType.iPhone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs: (null)
connected: yes
isWirelessEnabled: no
connectionType: direct
hostname: (null)
bonjourServiceName: 90:60:f1:6b:7f:91@fe80::9760:f1ff:fe6b:2f92._apple-mobdev2._tcp.local.
} (12.1 (16B92))

注意:当我运行它时,它会将我的应用程序和 webdriveragent 放入 iphone 设备然后停止。

【问题讨论】:

    标签: appium appium-ios


    【解决方案1】:

    我可以通过以下步骤解决问题:

    1. 卸载以下:

      Xcode、Appium、Xcode 命令行、ideviceinstaller、carthage、xpretty、deviceconsole

    2. 按照此视频指南重新安装所有内容:https://youtu.be/ySglJIrDVMQ

    3. 重启我的mac机器和iphone

    4. 按照此视频指南在 xcode 中再次设置项目:https://youtu.be/ySglJIrDVMQ

    5. 是的,它有效。

    【讨论】:

    • 如果您可以总结视频,这将是一个更有帮助的答案。实际问题是什么,解决方案是什么?如果链接的视频消失了,那么当前状态下的答案将毫无用处。
    【解决方案2】:

    对于 iOS 开发,我使用 FastlaneXCTest 框架,我遇到了与您描述的相同的问题。但是,我使用的是模拟器,而不是真实设备。为了解决这个问题,我在应该用于测试的模拟器列表中将 iPhone 6 替换为 iPhone XS Max。如果您还可以使用不同于 iPhone 6 的任何其他设备,您应该尝试此解决方案。

    但是,如果您需要在 iPhone 6 上测试您的应用程序,您可以重新创建相应的模拟器。在 Xcode 10.1 中按 Window -> Devices and Simulators,然后选择名为 iPhone 6 的行并按 Backspace。之后按窗口左下角的+创建一个新的模拟器。你会看到这个窗口:

    按照屏幕截图中的方式设置所有参数,然后按创建。之后,尝试再次运行您的测试套件。

    【讨论】:

      猜你喜欢
      • 2011-10-02
      • 2018-02-18
      • 2020-10-06
      • 1970-01-01
      • 1970-01-01
      • 2018-09-28
      • 2018-03-11
      • 2013-01-27
      • 2021-12-17
      相关资源
      最近更新 更多