简体   繁体   English

Xcode UI测试:lldb错误“仅适用于iOS 9.0或更高版本”

[英]Xcode UI Testing: lldb error “only available on iOS 9.0 or newer”

Background 背景

I have a fairly detailed (around 2000 lines of swift code) automation framework built with Xcode 7.3 and Swift for our iOS app. 我有一个相当详细的(约2000行快速代码)自动化框架,使用Xcode 7.3和Swift为我们的iOS应用程序构建。

Up till a recent point, I was able to use lldb to build my framework ie 直到最近一点,我能够使用lldb来构建我的框架,即

  • insert breakpoint and run code up till that point 插入断点并运行代码直到那一点
  • use po XCUIApplication().debugDescription and expr bla bla to build the logic 使用po XCUIApplication().debugDescriptionexpr bla bla来构建逻辑
  • repeat 重复

Problem 问题

Pretty much all of a sudden, I now encounter the following error whenever running anything inside lldb 's console: 几乎突然之间,每当在lldb的控制台中运行任何东西时,我现在都会遇到以下错误:

(lldb) po XCUIApplication()
error: <EXPR>:2:1: error: 'XCUIApplication' is only available on iOS 9.0 or newer
XCUIApplication()
^
<EXPR>:2:1: note: add 'if #available' version check
XCUIApplication()
^
<EXPR>:2:1: note: add @available attribute to enclosing instance method
XCUIApplication()
^
<EXPR>:2:1: note: add @available attribute to enclosing extension
XCUIApplication()
^
<EXPR>:10:9: warning: initialization of variable '$__lldb_error_result' was never used; consider replacing with assignment to '_' or removing it
    var $__lldb_error_result = __lldb_tmp_error
    ~~~~^~~~~~~~~~~~~~~~~~~~

Notes 笔记

Googling and research has not gotten me anywhere significant. 谷歌搜索和研究并没有让我有任何重要意义。 The one relevant thread I found was in the fastlane project . 我发现的一个相关主题是在fastlane项目中 Unlike that comment, mine is a UI Test target. 与该评论不同,我的是UI测试目标。 Also, the test target's "iOS Deployment Target" is set to iOS 9.2 (in case that helps). 此外,测试目标的“iOS部署目标”设置为iOS 9.2(如果有帮助)。

  • To the extent I remember, I haven't changed anything significantly in recent times. 在我记忆中,我近来没有发生任何重大变化。
  • My device is (and has always been) iOS 9+. 我的设备(并且一直是)iOS 9+。

What could be going wrong? 怎么可能出错?

Update 20 May 2016 2016年5月20日更新

Some exploration based on the answer below: https://stackoverflow.com/a/37335950/682912 根据以下答案进行一些探索: https//stackoverflow.com/a/37335950/682912

  • The issue happens only on real devices. 该问题仅在真实设备上发生。 Simulators do not face this problem. 模拟器不会遇到这个问题。
  • On real device (iPhone 6S+, iOS 9.2.1), I did a full reset of Content and Settings. 在真实设备(iPhone 6S +,iOS 9.2.1)上,我完全重置了内容和设置。 This did not fix the issue. 这并没有解决问题。

This is a bug in the debug agent installed on your device. 这是设备上安装的调试代理中的错误。 These are bound to the iOS version, so it probably happened when you upgraded your device. 这些绑定到iOS版本,因此可能会在您升级设备时发生。 Anyway, please file a bug with http://bugreporter.apple.com . 无论如何,请在http://bugreporter.apple.com上提交一个错误。

If I'm right about the problem, it should only happen when debugging to the device, not on the simulator. 如果我对这个问题是正确的,那么只有在调试设备时才会发生,而不是在模拟器上。 That might allow you a temporary workaround till the bug gets fixed. 这可能允许您临时解决方法,直到错误得到修复。

Double check your .xcconfig with your test target or any other means that may set your IPHONEOS_DEPLOYMENT_TARGET to lower than 9.0. 使用您的测试目标或任何其他可能将您的IPHONEOS_DEPLOYMENT_TARGET设置为低于9.0的方法仔细检查您的.xcconfig。 Since UITest is only available on iOS9.0 or later, change IPHONEOS_DEPLOYMENT_TARGET to 9.0+ should fix the issue. 由于UITest仅适用于iOS9.0或更高版本,因此将IPHONEOS_DEPLOYMENT_TARGET更改为9.0+应解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 centerXAnchor仅在iOS 9.0或更高版本中可用? - centerXAnchor is only available in iOS 9.0 or newer? “ NSBatchDeleteRequest”仅在iOS 9.0或更高版本上可用 - 'NSBatchDeleteRequest' is only available on iOS 9.0 or newer &#39;setNewsstandIconImage&#39;仅在iOS 9.0或更高版本上可用 - 'setNewsstandIconImage' is only available on iOS 9.0 or newer Swift 编译器错误 (Xcode):Concurrency is only available in iOS 15.0.0 or newer - Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer Xcode 11 “'==' 仅在 iOS 13.0 或更高版本中可用”错误 - Xcode 11 “'==' is only available in iOS 13.0 or newer” error XCode 编译错误:confirmationDialog 仅可用 IOS 15.0 或更高版本 - XCode compile error: confirmationDialog is only available IOS 15.0 or newer “ SFSafariViewController”仅在iOS 9.0或更高版本(React Native Build)上可用 - 'SFSafariViewController' is only available on iOS 9.0 or newer (React Native Build) XCUIApplication仅适用于iOS 9.0或更高版本的swift3 - XCUIApplication is only available on iOS 9.0 or newer, swift3 Xcode 7-&#39;xxx&#39;仅在iOS 8.0或更高版本上可用 - Xcode 7 - 'xxx' is only available on iOS 8.0 or newer Xcode 10'frame'仅适用于iOS 12.0或更新的编译错误iOS 12 beta - Xcode 10 'frame' is only available on iOS 12.0 or newer compilation error iOS 12 beta
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM