如何在 Xcode 中运行 iPad 模拟器?

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

How do I run an iPad Simulator in Xcode?

xcodeipadios-simulator

提问by psvj

I am trying to run an iPad simulator on Xcode, but currently I only have one option when I go to Xcode > Open Developer Tool > Simulator, which launches the iPhone simulator.

我正在尝试在 Xcode 上运行 iPad 模拟器,但目前我只有一个选项,当我转到 Xcode > Open Developer Tool > Simulator 时,它会启动 iPhone 模拟器。

How do I launch the iPad simulator?

如何启动 iPad 模拟器?

回答by Tamás Sengel

You should select an iPad device by navigating to

您应该通过导航到 iPad 设备

Hardware/Device/[OS version if you have multiple OS versions installed]/[device]

硬件/设备/[操作系统版本,如果您安装了多个操作系统版本]/[设备]

in the simulator's menu.

在模拟器的菜单中。

Hardware/Device/[OS version if you have multiple OS versions installed]/[device]

硬件/设备/[操作系统版本,如果您安装了多个操作系统版本]/[设备]

If there are no iPad devices in the list, follow these instructions:

如果列表中没有 iPad 设备,请按照以下说明操作:

  1. Click on Hardware/Device/Manage Devices...

    Hardware/Device/Manage Devices...

  2. Select the Simulatorsoption on the top.

    "Simulators" option selected

  3. Press the plus (+) sign in the lower-left corner.

    Plus sign in the lower-left corner

  4. Define the name, the device type and the OS version of the new simulator, then click on Create.

    Options for the new simulator

  1. 单击硬件/设备/管理设备...

    硬件/设备/管理设备...

  2. 选择顶部的模拟器选项。

    选择了“模拟器”选项

  3. 按左下角的加号 ( +)。

    左下角的加号

  4. 定义新模拟器的名称、设备类型和操作系统版本,然后单击Create

    新模拟器的选项

For more information, check out Getting started in Simulator.

有关更多信息,请查看模拟器入门

回答by Aaron

For bonus points :)

对于奖励积分:)

I would also extract the simulator from inside Xcode to make it more accessible.

我还会从 Xcode 内部提取模拟器以使其更易于访问。

Applications / Xcode.app( right click and select "Show Package Contents" )

Applications / Xcode.app(右键单击并选择“显示包内容”)

From this folder Contents / Developer / Applications / Simulator.app

从这个文件夹 Contents / Developer / Applications / Simulator.app

Create a shortcut to that and simulator opens without opening the main Xcode.app

创建一个快捷方式,无需打开主 Xcode.app 即可打开模拟器

回答by ROOT

This is for Xcode 11.2.1+

这适用于 Xcode 11.2.1+

open XCode, from the App menu:

从 App 菜单中打开 XCode:

Xcode -> Open Developer Tool -> Simulator

Xcode -> 打开开发者工具 -> 模拟器

enter image description here

在此处输入图片说明

This will open the latest iPhone simulator and to change it to anything else e.g iPad:

这将打开最新的 iPhone 模拟器并将其更改为其他任何东西,例如 iPad:

Hardware -> Device -> iOS -> iPad

硬件 -> 设备 -> iOS -> iPad

enter image description here

在此处输入图片说明