Xcode 5/6:查看调试总是灰显?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24040322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:00:25  来源:igfitidea点击:

Xcode 5/6: View Debugging always grayed out?

iosxcodexcode5

提问by Binks

The "Debug / View Debugging" menu is always grayed out for me in Xcode 5 (and 6), even when the target is stopped at a breakpoint. How do I enable it?

“调试/查看调试”菜单在 Xcode 5(和 6)中对我来说总是灰显的,即使目标在断点处停止也是如此。我如何启用它?

Debug / View Debugging

调试/查看调试

回答by Daniel

For me (Xcode 6 Beta and Beta two) the View Debugging options are only enabled in 32bit simulators (e.g. works when I use 'iPhone 5' but not when I am using 'iPhone 5s')

对我而言(Xcode 6 Beta 和 Beta 2),查看调试选项仅在 32 位模拟器中启用(例如,当我使用“iPhone 5”时有效,但当我使用“iPhone 5s”时无效)

回答by ThomasW

I believe that the Capture View Hierarchy feature is only available when the target is running iOS 8.

我相信 Capture View Hierarchy 功能仅在目标运行 iOS 8 时可用。

In Xcode 6 (beta 2) the schema popup on the toolbar lets you choose the type of simulated device. For me the fixed devices show up three times. This is because I have three environments available: iOS 7, iOS 7.1 and iOS 8. However, this information is missing from the popup, which appears to be an Xcode 6 bug. The bottom group of devices, including "Resizable iPhone" and "Resizable iPad", are running iOS 8. If you use one of these devices the View Debugging -> Capture View Hierarchy menu item becomes available.

在 Xcode 6 (beta 2) 中,工具栏上的模式弹出窗口允许您选择模拟设备的类型。对我来说,固定设备出现了 3 次。这是因为我有三个可用环境:iOS 7、iOS 7.1 和 iOS 8。但是,弹出窗口中缺少此信息,这似乎是 Xcode 6 错误。底部的一组设备,包括“可调整大小的 iPhone”和“可调整大小的 iPad”,正在运行 iOS 8。如果您使用这些设备之一,则可以使用“视图调试”->“捕获视图层次结构”菜单项。

However, iOS Simulator -> Hardware -> Device -> Manage Devices… lets you edit the device names to make them more informative.

但是,iOS 模拟器 -> 硬件 -> 设备 -> 管理设备...允许您编辑设备名称以使其更具信息性。

Note that this crashes for me every time I try to view a hierarchy that is using a UIMapView.

请注意,每次我尝试查看使用 UIMapView 的层次结构时,都会崩溃。

回答by Michael Thiel

Also make sure that view debugging isn't disabled in your current scheme's run options:

还要确保在当前方案的运行选项中没有禁用视图调试:

Xcode settings for view debugging

用于视图调试的 Xcode 设置

Xcode 6.1 still has the limitations about view debugging only working on 32 bit devices (iPhone 5 or older) and on iOS 8, though.

不过,Xcode 6.1 仍然存在只能在 32 位设备(iPhone 5 或更早版本)和 iOS 8 上进行视图调试的限制。

回答by Lavare

  1. Test environment :Xcode version 6.1 (6A1052d)

    Test project:My project ( support for 64- bit and iOS deployment target is iOS6)

    Test results:The View Debugging options are only enabled in iPhone5 with iOS8

  2. Test environment :Xcode Version 6.1 (6A1052d)

    Test project :Xcode-ViewDebugging( supports 64- bit and iOS deployment target is iOS8)

    Test results :The View Debugging options are enabled in all simulators with iOS8

  3. So be sure that it must be iOS8, but still do not know the specific rules

  1. 测试环境:Xcode 6.1 (6A1052d)

    测试项目:我的项目(支持64位,iOS部署目标为iOS6)

    测试结果:View Debugging 选项仅在 iPhone5 和 iOS8 中启用

  2. 测试环境:Xcode Version 6.1 (6A1052d)

    测试项目:Xcode-ViewDebugging(支持64位,iOS部署目标为iOS8)

    测试结果:所有iOS8模拟器都启用了View Debugging选项

  3. 所以确定一定是iOS8,但还是不知道具体的规则

回答by Youval Vaknin

By adding support for 64bit (arm64) in your target, View Debugging is enabled for 64bit devices (iPhone 5s, iPhone 6 and iPhone 6 Plus)

通过在目标中添加对 64 位 (arm64) 的支持,为 64 位设备(iPhone 5s、iPhone 6 和 iPhone 6 Plus)启用了查看调试

In your target build settings make sure under Architectures that standard architectures is checked $(ARCHS_STANDARD), and under Valid Architectures you have arm64.

在您的目标构建设置中,确保在 Architectures 下选中了标准架构 $(ARCHS_STANDARD),在 Valid Architectures 下您有 arm64。

回答by lorixx

I have the same issue as well, but I could see it enabled when I create a new project using Swift.

我也有同样的问题,但是当我使用 Swift 创建一个新项目时,我可以看到它已启用。

回答by JongAm Park

Hmm.. people just guess it's targeted for iOS. On my OS X 10.8 MacBook pro with Xcode 5.1.1, sometimes the menu its always disabled for a project for Mac OS X.

嗯.. 人们只是猜测它是针对 iOS 的。在我的 OS X 10.8 MacBook pro 和 Xcode 5.1.1 上,有时菜单对于 Mac OS X 的项目总是被禁用。

On my OS X 10.9 Mac mini with Xcode 5.1.1, it is enabled.

在我的 OS X 10.9 Mac mini 和 Xcode 5.1.1 上,它已启用。

Looks to me a bug..

在我看来是一个错误..

回答by yiyang

Another option for view debugging is iOS-Hierarchy-Viewer: https://github.com/glock45/iOS-Hierarchy-Viewer

视图调试的另一个选项是 iOS-Hierarchy-Viewer:https: //github.com/glock45/iOS-Hierarchy-Viewer