目标工具栏在 XCode 6.4 上消失了

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31318316/
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 07:26:47  来源:igfitidea点击:

Destination toolbar disappeared on XCode 6.4

xcodeios-simulator

提问by CrApHeR

Today in the morning I tried to compile my project to run in my device and I found the destination toolbar disappeared and I cannot choose my IOS device or IOS Simulator device as target. (I can do it in the Product/Destination Menu)

今天早上我试图编译我的项目以在我的设备上运行,我发现目标工具栏消失了,我无法选择我的 IOS 设备或 IOS 模拟器设备作为目标。(我可以在产品/目的地菜单中完成)

XCode6Toolbar

XCode6工具栏

After some research I found the >>at the right on the screen and when I pushed a Scheme option appeared but it is disabled and I can't enable again.

经过一番研究,我>>在屏幕右侧找到了,当我按下 Scheme 选项时,它出现了,但它被禁用了,我无法再次启用。

This is what I tried with no success:

这是我尝试但没有成功的方法:

  • Open an old project to see if the problem was in my project

  • Create a new project (with Swift and Objective C but I don't think this make any difference)

  • Restart my computer

  • Hide and show the toolbar (View menu/Hide Toolbar and the View menu/Show Toolbar)

  • I tried all the previous options with the device connected and disconnected

  • 打开一个旧项目,看看问题是否出在我的项目中

  • 创建一个新项目(使用 Swift 和 Objective C,但我认为这没有任何区别)

  • 重新启动我的电脑

  • 隐藏和显示工具栏(查看菜单/隐藏工具栏和查看菜单/显示工具栏)

  • 我在连接和断开设备的情况下尝试了所有以前的选项

I have installed the IOS Simulator 8.4 (when I run my project it runs in the last selected simulator) and XCode 6.4.

我已经安装了 IOS Simulator 8.4(当我运行我的项目时,它会在最后选择的模拟器中运行)和 XCode 6.4。

采纳答案by Brandon Williams

Looks like Xcode hides that menu when the window is a certain size. I have to make my window quite large before it comes back.

当窗口达到一定大小时,Xcode 似乎隐藏了该菜单。在它回来之前,我必须把我的窗户弄得很大。

回答by Chris Mitchelmore

Not a fix as such but you can work around it using the menus: Product > Scheme and Product > Destination

不是这样的修复,但您可以使用菜单解决它:产品 > 方案和产品 > 目的地

回答by Mason G. Zhwiti

You're probably running into the same issue I am. Like @BrandonWilliams said in his answer, it appears again if the Xcode window is wide enough. The underlying cause, for me at least, seems to be that in this build of Xcode (6.4) running on El Capitan beta 2 (with Xcode 7 beta installed), I am seeing duplicate simulators for iOS 8.4. And since there are two of the same version, the Schemes dropdown shows some sort of long GUID next to each one, causing the Scheme dropdown to be quite large:

你可能遇到了和我一样的问题。就像@BrandonWilliams 在他的回答中所说的那样,如果 Xcode 窗口足够宽,它会再次出现。至少对我来说,根本原因似乎是在 El Capitan beta 2(安装了 Xcode 7 beta)上运行的 Xcode (6.4) 版本中,我看到了 iOS 8.4 的重复模拟器。由于有两个相同的版本,Schemes 下拉列表在每个旁边显示某种长 GUID,导致 Scheme 下拉列表非常大:

回答by ucangetit

I came to SO looking for an answer but realized that I had seen this issue before.

我来到 SO 寻找答案,但意识到我以前见过这个问题。

So the problem is basically that auto layout sucks (I mean it is not working properly in Xcode 6) and on El Capitan, the destination toolbar is for some reason hiding instead of collapsing properly. So when your Xcode window is narrow, the destination toolbar disappears.

所以问题基本上是自动布局很糟糕(我的意思是它在 Xcode 6 中不能正常工作)并且在 El Capitan 上,目标工具栏由于某种原因隐藏而不是正确折叠。因此,当您的 Xcode 窗口变窄时,目标工具栏就会消失。

toolbar is missing

工具栏不见了

But, if you expand the window far enough, it shows back up again.

但是,如果您将窗口扩展得足够远,它会再次显示出来。

There it is again

又来了

In case you can't tell, in the first screenshot, the window is about 1241 pixels wide and in the second screenshot the window is 1541 pixels wide.

如果您不知道,在第一个屏幕截图中,窗口的宽度约为 1241 像素,而在第二个屏幕截图中,窗口的宽度为 1541 像素。

回答by Burhan Ahmad

Go to Product then Destination and choose at which simulator or device you want to test your build.enter image description here

依次转到产品和目的地,然后选择要测试构建的模拟器或设备。在此处输入图片说明

回答by Jayprakash Dubey

I'm running with same problem. You can select device or change scheme using below steps:

我正在运行同样的问题。您可以使用以下步骤选择设备或更改方案:

  1. Select Productfrom menu
  2. Select Schemeor Destination
  3. Select required Scheme optionor Destination option
  1. 从菜单中选择产品
  2. 选择方案目的地
  3. 选择所需的方案选项目的地选项

Screenshot for fix

修复截图

Alternative Solution:

替代解决方案:

The only solution is to use Xcode 7 or above. I've installed Xcode 7.1 and found Scheme/Simulator list available. Refer screenshot.

唯一的解决办法是use Xcode 7 or above。我已经安装了 Xcode 7.1 并发现 Scheme/Simulator list available。参考截图。

It seems that Xcode 6 or below doesn't support OS X El Capitan.

Xcode 6 或以下似乎不支持 OS X El Capitan。

Screenshot for perfect solution

完美解决方案截图

回答by Yuchen Zhong

I am still seeing this problem in Xcode 7.2 on iMac with resolution 1920x1080. Resizing the XCode windows dens't help. I can have the menu bar back if I push the green button and go to full screen mode. But that's pretty annoying. This is how I finally figure out a solution that works for me. I notice that only if I open the project file that I have been working daily that the menu bar is missing. If I create a new project, the menu bar is there. And here is my solution:

我仍然在分辨率为 1920x1080 的 iMac 上的 Xcode 7.2 中看到这个问题。调整 XCode 窗口的大小无济于事。如果我按下绿色按钮并进入全屏模式,我可以恢复菜单栏。但这很烦人。这就是我最终找出适合我的解决方案的方式。我注意到只有当我打开我每天都在工作的项目文件时,菜单栏才会丢失。如果我创建一个新项目,菜单栏就在那里。这是我的解决方案:

  1. Remove your project file on disc (or move it to a different folder)

  2. Open the Welcome to Xcodewindow by shift+command+1

  3. Make sure your project is no longer under this list. If it is still there, click on it and Xcode will tell you the project is not found and it will be removed.

  1. 删除光盘上的项目文件(或将其移动到其他文件夹)

  2. 通过shift+command+1打开Welcome to Xcode窗口

  3. 确保您的项目不再在此列表中。如果它仍然存在,单击它,Xcode 会告诉您未找到该项目并将其删除。

enter image description here

在此处输入图片说明

  1. Add the project file back and open it and I have my menu bar back (if you have moved it, simply opening it from a different file location may work I guess)
  1. 重新添加项目文件并打开它,我的菜单栏又回来了(如果你移动了它,我猜只需从不同的文件位置打开它就可以了)

I guess the problem is that some cache value in Xcode about the project file is messed up somehow. Hope this helps.

我猜问题是 Xcode 中关于项目文件的一些缓存值以某种方式搞砸了。希望这可以帮助。

回答by Rex

I make my XCode screen little big and now find both options.

我让我的 XCode 屏幕有点大,现在找到了两个选项。

回答by Yasha

On XCode 9.0 beta, this worked for me: select View -> Show Toolbarfrom menu

在 XCode 9.0 beta 上,这对我有用:View -> Show Toolbar从菜单中选择

回答by MobileEvangelist

right click on title bar -> select show toolbar

右键单击标题栏 -> 选择显示工具栏