如何在全屏(狮子)Xcode 4.1 上运行 iPhone 模拟器?

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

How can I run iPhone simulator over full-screen(lion) Xcode 4.1?

xcodeosx-lion

提问by moon6pence

I love to work with full-screen mode Xcode, but there's one inconvenience,

我喜欢使用全屏模式 Xcode,但有一个不便之处,

If I run iPhone simulator, it is shown in other space.

如果我运行 iPhone 模拟器,它会显示在其他空间。

Is there any way to run iPhone simulator over full-screen Xcode?

有没有办法在全屏 Xcode 上运行 iPhone 模拟器?

If then, I can work with happiness really!

如果那样的话,我真的可以快乐地工作了!

采纳答案by Tomas Baran

As others point out, Apple doesn't allow to run two full screen apps one over the other one. However, you could put them next to each other like this which already is an enhancement (at least for me):

正如其他人指出的那样,Apple 不允许运行两个全屏应用程序一个在另一个之上。但是,您可以像这样将它们并排放置,这已经是一种增强功能(至少对我而言):

enter image description here

在此处输入图片说明

I use VS Code instead of Xcode but the logic is the same. All you have to do is just to allow iOS Simulator to run in Full Screen by running the following command in terminal:

我使用 VS Code 而不是 Xcode,但逻辑是相同的。您所要做的就是通过在终端中运行以下命令来允许 iOS 模拟器在全屏模式下运行:

defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES

回答by todd412

There doesn't seem to be any way to do this. I think part of the idea of having a full-screen mode is that you cannothave any other windows open on top of the full-screen window.

似乎没有任何方法可以做到这一点。我认为拥有全屏模式的部分想法是您不能在全屏窗口之上打开任何其他窗口。

Try opening Xcode in full-screen mode, then open the organizer window, and you'll see what I mean. The organizer opens in its ownfull-screen mode space.

尝试以全屏模式打开 Xcode,然后打开管理器窗口,您就会明白我的意思。组织者在其自己的全屏模式空间中打开。

Which makes sense, even though it's inconvenient in this case. I think if Apple were to give the iOS simulator its own full-screen mode, that would be nicer than just throwing it up on a desktop.

这是有道理的,即使在这种情况下很不方便。我认为,如果 Apple 为 iOS 模拟器提供自己的全屏模式,那会比将它扔在桌面上更好。

It seems like the ideal solution would be for Apple to integrate the iOS simulator into the Xcode debugging environment, similar to what they did with Interface Builder in Xcode 4.

对于 Apple 来说,理想的解决方案似乎是将 iOS 模拟器集成到 Xcode 调试环境中,类似于他们在 Xcode 4 中使用 Interface Builder 所做的。

回答by shan kulkarni

To run simulators in full-screen mode, you need to enable fullscreen mode by executing the following command in your terminal:

要以全屏模式运行模拟器,您需要通过在终端中执行以下命令来启用全屏模式:

defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES

defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES

*You need to restart the simulator in order to reflect the changes.

*您需要重新启动模拟器以反映更改。

回答by keldar

Just so you know, you can now do this as of Xcode 9. You need to enable the Internal menu in iOS Simulator.

正如您所知,您现在可以从 Xcode 9 开始执行此操作。您需要在 iOS 模拟器中启用内部菜单。

To do this:

去做这个:

  1. Create the folder AppleInternalin the root directory: sudo mkdir /AppleInternal

  2. Restart all instances of the iOS Simulator.

  3. Observe the available Internal menu, navigate to Internal | Allow Fullscreen Modeand ensure this option is ticked.
  1. AppleInternal在根目录下创建文件夹:sudo mkdir /AppleInternal

  2. 重新启动 iOS 模拟器的所有实例。

  3. 观察可用的内部菜单,导航到Internal | Allow Fullscreen Mode并确保选中此选项。

After following these steps, you can enable fullscreen mode on the iOS simulator.

完成这些步骤后,您可以在 iOS 模拟器上启用全屏模式。

Information taken from: https://medium.com/flawless-app-stories/simulator-on-steroids-c12774ca6b

信息取自:https: //medium.com/flawless-app-stories/simulator-on-steroids-c12774ca6b

回答by Omnia

  1. Shut down your Mac,
  2. Boot into the Recovery Mode, When shut, start pressing CMD + Rand while still pressing power up your machine and keep pressing the button combination until the Apple logo appears so that your Mac boots into the Recovery Mode.
  3. Click Utilitesand choose Terminal
  4. Type diskutil listand identify the id of your disk named Macintosh HD, it should be something like /dev/disk2s1
  5. Now we need to mount it: type diskutil mount /dev/[YOUR_DISK_ID]. If successful, keep going with the next step. If not, you probably got a message regarding APFS that the disk needs to be unlocked, so type diskutil apfs unlockVolume /dev/[YOUR_DISK_ID]
  6. Finally you can create the required folder to enable hidden Xcode features: type mkdir /Volumes/[YOUR_MAC_DRIVE_NAME]/AppleInternalNow you can get out of the Recovery Mode and boot your Mac as usual. Open and run your project on simulator. Now you can see a new bar menu item named Internal. There is an option to set simulator to fullscreen.
  1. 关闭你的 Mac,
  2. 启动进入恢复模式,关闭后,开始按CMD + R并同时按下机器电源并继续按下按钮组合,直到出现 Apple 标志,以便您的 Mac 启动进入恢复模式。
  3. 单击实用程序并选择终端
  4. 键入diskutil list并确定名为 Macintosh HD 的磁盘的 ID,它应该类似于/dev/disk2s1
  5. 现在我们需要挂载它:键入diskutil mount /dev/[YOUR_DISK_ID]. 如果成功,继续下一步。如果没有,您可能会收到一条有关 APFS 的消息,提示磁盘需要解锁,因此请键入diskutil apfs unlockVolume /dev/[YOUR_DISK_ID]
  6. 最后,您可以创建所需的文件夹以启用隐藏的 Xcode 功能:输入mkdir /Volumes/[YOUR_MAC_DRIVE_NAME]/AppleInternalNow you can get out of the Recovery Mode 并像往常一样启动 Mac。在模拟器上打开并运行您的项目。现在您可以看到一个名为Internal的新栏菜单项。有一个选项可以将模拟器设置为全屏。

回答by Felix

I recommend going with BetterSnapToolor something similar. Then you can easily size the window to take up the full screen without losing the use of a second monitor or the ability to see Xcode and the simulator as you're debugging.

我建议使用BetterSnapTool或类似的东西。然后,您可以轻松调整窗口大小以占据全屏,而不会丢失第二个监视器的使用或在调试时查看 Xcode 和模拟器的能力。

回答by rennarda

This doesn't directly answer this question, but it's worth noting that under Xcode 4.6 at least the Organizer window will open on a second screen even if Xcode is running full-screen.

这并不能直接回答这个问题,但值得注意的是,在 Xcode 4.6 下,即使 Xcode 全屏运行,管理器窗口也会在第二个屏幕上打开。

Also, I highly recommend Dash as a documentation viewer, as this can be set to 'HUD' window mode, and therefore be visible on a second monitor even when Xcode is full screen.

另外,我强烈推荐 Dash 作为文档查看器,因为它可以设置为“HUD”窗口模式,因此即使在 Xcode 全屏时也可以在第二台显示器上看到。

Still want to know how to do this with the Simulator

仍然想知道如何用模拟器做到这一点

回答by robodo

You can change the Debug Workflow in Xcode to "Xcode Always Behind". When you are coding you can use full screen mode, when you are debugging, you will see Xcode in the background.

您可以将 Xcode 中的 Debug Workflow 更改为“Xcode Always behind”。编码时可以使用全屏模式,调试时会在后台看到Xcode。

enter image description here

在此处输入图片说明

回答by skinsfan00atg

Don't know if anyone is still looking, but the best way is to use Xcode behaviors. In the Running section, under Starts, select Exit Full Screen. Then under Completes, select Enter Full Screen. Works great!

不知道有没有人还在看,不过最好的方法是使用Xcode行为。在运行部分的开始下,选择退出全屏。然后在“完成”下,选择“进入全屏”。效果很好!

回答by MendyK

All you need to do is (in your simulator) go to window/stay In Front. Just like this

您需要做的就是(在您的模拟器中)转到 window/stay In Front. 像这样

enter image description here

在此处输入图片说明

Hope this helps!

希望这可以帮助!