首页 > 解决方案 > 如何在 Xcode 模拟器中关闭 iPhone X?

问题描述

我自己运行 Xcode Simulator 进行 Web 开发测试。当模拟器启动时,它总是启动 iPhone X (iOS 11.3),因为它在我上次退出模拟器时正在运行,因为我不知道如何关闭手机。

我无法在模拟器中同时按下(虚拟)电源和音量按钮(就像在真实手机上所做的那样),并且由于某种原因,“设置”>“常规”区域没有“关机”选项。 " 我可以从模拟器的“硬件”菜单重新启动设备,但似乎没有关闭手机的选项(即使持有额外的键盘修改器)。

我错过了什么或者这不可能吗?

说明:

找到解决方法

当 Simulator 自行启动时(不是通过 Xcode 项目),如果它保持运行,它将重新启动从 Hardware 菜单激活的最后一个仿真。因此,如果我启动新的东西,然后让它和 iPhone X 模拟器都运行,当我退出模拟器时,它将在下次使用新硬件时重新启动,而不是 iPhone X。

我仍然对任何告诉 iPhone X 硬件关闭(如果存在这种情况)的方法感兴趣,因为我经常不得不在硬件模拟之间切换,而且能够做到这一点而不必重新启动以摆脱 iPhone X。

标签: iosxcodesimulatoriphone-x

解决方案


Change your simulator to required version from Hardware -> Device -> That way you will have correct version loaded and of course there is no way of "Shutdown" a simulator but quit, as this is just an application not hardware. If you have multiple simulators open, you can close the not required ones by highlighting them and select File -> Close Window or CMD+W

Another good info from Colin :

I also just noticed that if I turn off "show device bezels" I get regular window controls for closing the window, too.


推荐阅读