如何调整 iPhone/iPad 模拟器的大小?

发布于 2024-11-10 04:46:37 字数 184 浏览 1 评论 0原文

在我的 23 英寸全高清屏幕上(以及在 15 英寸 MacBook Pro 上),iPad 模拟器非常小(只有真实 iPad 屏幕大小的三分之一) )。

有办法调整它的大小吗?

我知道它必须保持尺寸和 dpi 比率以防止出现子像素,但如果没有放大镜我几乎看不到任何东西。

The iPad-simulator is really small (like one third the size of the real iPad screen) on my 23" Full-HD screen (and also on the 15" MacBook Pro).

Is there a way to resize it?

I know it must maintain size and dpi-ratio to prevent sub-pixels, but I can hardly see anything withoout a magnifier.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

诠释孤独 2024-11-17 04:46:37

+1 为 100%
+2 为 75%
+3 为 50%

+1 for 100%
+2 for 75%
+3 for 50%

若相惜即相离 2024-11-17 04:46:37

使用 Xcode 9-Simulator 更加灵活。只需选择 &拖动模拟器的任意角来调整其大小并根据您的要求进行设置。

看一下这个快照:

在此处输入图像描述


注意:在 Xcode 9.1+ 中,模拟器缩放选项已更改。< /强>

键盘快捷键

根据 Xcode 9.1+

Physical Size       ⌘ 1      command + 1
Pixel Accurate      ⌘ 2      command + 2

根据 Xcode 9

50% Scale           ⌘ 1      command + 1
100% Scale          ⌘ 2      command + 2
200% Scale          ⌘ 3      command + 3

Xcode 菜单中的模拟器缩放选项

Xcode 9.1+:

菜单栏 ▶ 窗口 ▶ “此处,可用选项更改模拟器比例”(物理尺寸像素精确度

像素精确:调整您的尺寸模拟器到实际(物理)设备的像素,如果您的 mac 系统显示屏幕尺寸(像素)支持那么高的分辨率,否则此选项将保持禁用状态。

在此处输入图像描述

Xcode 9.0

菜单栏 ▶ 窗口 ▶ 比例 ▶ “此处,可用选项更改模拟器比例”

在此处输入图像描述


使用终端命令

按照以下步骤使用终端命令

  1. 关闭/退出模拟器来缩放模拟器。 (如果打开)
  2. 打开 Terminal 应用程序(使用 Spotlight 搜索,按 ⌘ + SPACE 打开 Spotlight 搜索)
  3. 复制以下文本并将其粘贴到终端光标旁边。

默认写入 ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"

  1. 打开“模拟器”(使用 Xcode 运行您的 iOS 项目)。

您会发现模拟器规模更新。


It's more flexible with Xcode 9-Simulator.Just pick & drag any corner of simulator to resize it and set it according to your requirement.

Look at this snapshot:

enter image description here


Note: With Xcode 9.1+, Simulator scale options are changed.

Keyboard short-keys:

According to Xcode 9.1+

Physical Size       ⌘ 1      command + 1
Pixel Accurate      ⌘ 2      command + 2

According to Xcode 9

50% Scale           ⌘ 1      command + 1
100% Scale          ⌘ 2      command + 2
200% Scale          ⌘ 3      command + 3

Simulator scale options from Xcode Menu:

Xcode 9.1+:

Menubar ▶ Window ▶ "Here, options available change simulator scale" (Physical Size & Pixel Accurate)

Pixel Accurate: Resizes your simulator to actual (Physical) device's pixels, if your mac system display screen size (pixel) supports that much high resolution, else this option will remain disabled.

enter image description here

Xcode 9.0

Menubar ▶ Window ▶ Scale ▶ "Here, options available change simulator scale"

enter image description here


Using Terminal Command

Follow these steps to scale simulator using terminal commands

  1. Close/Quit simulator. (if open)
  2. Open Terminal app (using Spotlight search, Press ⌘ + SPACE to open spotlight search)
  3. Copy following text and paste it next to terminal cursor.

defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"

  1. Open 'Simulator' (Run your iOS project using Xcode).

You will find simulator scale update.


喜爱皱眉﹌ 2024-11-17 04:46:37

Xcode 9.x:

  1. 选择 Simulator
  2. 转到 Window 选项卡
  3. 选择 Physical Size 选项 (cmd + 1< /code>)

“截图1”

现在,如果这不能根据您的兴趣调整大小,请按照以下步骤操作:

  1. 选择模拟器
  2. 转到模拟器边缘。这将将您的光标转换为调整大小选项(双向箭头)。
  3. 现在,使用此调整大小选项,您可以根据需要更改大小

Xcode 8 或更低版本:

https://stackoverflow.com/a/30588057/1753005

Xcode 9.x :

  1. Select Simulator
  2. Goto Window tab
  3. Select Physical Size option (cmd + 1)

Screenshot 1

Now if this dosen’t make size as per your interest then follow below steps :

  1. Select Simulator
  2. Goto edge of simulator. This will convert your cursor to resize option (Bidirectional arrow).
  3. Now using this resize option you can change the size as you desire.

Xcode 8 or below :

https://stackoverflow.com/a/30588057/1753005

落花随流水 2024-11-17 04:46:37

对于 Xcode 9、Beta 6:取消选择“窗口”菜单下的“显示设备边框”。然后 Cmd + 2 应缩放至 100%(窗口菜单 -> 缩放 -> 100%)。

使用 15 英寸 Macbook Pro(2017 型号)进行测试。

For Xcode 9, Beta 6: Deselect "Show Device Bezels" under Window menu. Then Cmd + 2 should scale to 100% (Window Menu -> Scale -> 100%).

Tested using 15" Macbook Pro (2017 Model).

欢烬 2024-11-17 04:46:37

您可以这样做:

窗口>取消选中“显示设备边框”

之后,您可以自定义模拟器的宽度和长度。
如果您对其尺寸感到满意,您可以再次检查“显示设备边框”

You can do this:

Window > Uncheck Show Device Bezels

After that, you can customize your simulator's width and length.
If you're satisfied in its size, you can check again the 'Show Device Bezels'

蒲公英的约定 2024-11-17 04:46:37

对于 XCode 10,我最终不得不这样做

defaults delete ~/Library/Preferences/com.apple.iphonesimulator DevicePreferences

,我只是找不到任何其他方法来重置缩放级别。即使使用“窗口”->“缩放”来切换缩放,也无法恢复到 100%(2042x2732 iPad 12.9 英寸)。

删除设备首选项允许模拟器再次以全分辨率打开,因此我可以拍摄应用程序商店提交所需的屏幕截图。

物理尺寸像素精确选项保持灰色。

For XCode 10 I ended up having to do

defaults delete ~/Library/Preferences/com.apple.iphonesimulator DevicePreferences

I just could not find any other way to reset zoom level. Even using Window->Zoom to toggle zoom, would not restore back to 100% (2042x2732 iPad 12.9-inch).

Deleting device preferences allowed the simulator to open at full resolution again, so I could take the screen shots required for app store submission.

The Physical Size and Pixel Accurate options remain greyed out.

草莓味的萝莉 2024-11-17 04:46:37

目前,旧的缩放系统(100%、75%等)已被删除,但在窗口选项卡下有四个选项:

  • 物理尺寸
  • 点精确
  • 像素精确
  • 适合屏幕
    可以通过以下方式切换:

+1

+2

+< kbd>3

+4

如下所示:

在此处输入图像描述

Currently, the old scale system (100%, 75%, etc.) is removed, but under Window tab there are four options:

  • Physical Size
  • Point Accurate
  • Pixel Accurate
  • Fit Screen
    Which can be toggled with:

+1

+2

+3

+4

As seen below:

enter image description here

落叶缤纷 2024-11-17 04:46:37

但是在较小的屏幕(MacBook Pro 15 英寸)中,我无法将其缩放到超过屏幕尺寸

很少有实用程序可以让您将显示分辨率设置得比系统偏好设置更高。

例如,如果您需要 12.9 英寸视网膜显示屏的纵向屏幕截图,分辨率为 2048 x 2732 像素。我只需使用这些实用程序之一(例如:App Store 中的显示菜单)即可将我的 Macbook Pro 2017 Retina 显示屏设置为 3360x2100。

之后,我使用 12,9" iPad Retina 启动 Xcode 模拟器,并将模拟器大小调整到屏幕的最大尺寸。结果,我得到的分辨率正好为 2048 x 2732,可以上传到 App Store。

在此处输入图像描述

希望这对某人有用。

But in the smaller screens(MacBook Pro 15-Inch), I can't scale it more than the screen size

There are little utilities that allows you to set your display resolution much higher as the System Preference may offer you.

For instance, if u need 12.9-Inch Retina Display screenshot with a resolution of 2048 x 2732 pixels for portrait. I simply use one of these utilities (e.g.: Display Menu from the App Store) to set my Macbook Pro 2017 Retina display to 3360x2100.

After that I start the Xcode Simulator with a 12,9" iPad Retina and resize the Simulator to the maximum of the screen. As a result, I get exactly 2048 x 2732 which is ready to upload to the App Store.

enter image description here

Hope that is useful for someone.

孤檠 2024-11-17 04:46:37

Xcode 9.x

您可以像在 Mac 中扩展任何窗口一样调整任何模拟器的大小。将鼠标移到任何模拟器的角上,指针就会发生变化。单击并拖动以放大/缩小模拟器。使用 Xcode 9.2 进行验证

Xcode 9.x

You can resize any simulator in the same way of expanding any windows in Mac. Move the mouse over the corner of any simulators and the pointer changes. Click and drag to expand/shrink the simulator. Verified using Xcode 9.2

爱的故事 2024-11-17 04:46:37

对于 Xcode 9.4,这是唯一有效的方法:
- 取消选中“调试”菜单中的“优化窗口大小渲染”。
- 使用文件 maenu 中的“⌘s”或“新屏幕截图”截取*屏幕截图。

*注意 - 无论模拟器大小如何,屏幕截图都将是上传到 iTunes Connect 的正确大小

For Xcode 9.4 this is the only thing which worked:
-Uncheck "Optimize rendering for window size" in the "Debug" menu.
-take a *screen shot using "⌘s" or "New screen shot" from the file maenu.

*note - it doesn't matter what size the simulator is, the screen shot will be the correct size for uploading to iTunes Connect

坠似风落 2024-11-17 04:46:37

CMD + Space

搜索系统偏好设置

然后选择辅助功能

选择缩放

检查 使用带有修饰键的滚动手势进行缩放:

选择 CMD 键或选项(无论您喜欢哪个)

就是这样:

现在在触控板上执行以下操作
CMD + 2根手指向上和向下滚动到放大缩小

在此处输入图像描述

CMD + Space

Search for System Preferences

Then Select Accessibility

Choose Zoom

Check Use scroll gesture with modifier keys to zoom:

Select CMD Key or Option (whichever you prefer)

Thats it:

Now on your trackpad do
CMD + 2 finger UP and Down to Scroll to Zoom in or Zoom out

enter image description here

汹涌人海 2024-11-17 04:46:37
  1. 看看这张照片。
  2. 请参阅红色提示。
  3. 您可以轻松调整 ios 模拟器的大小。

屏幕截图

  1. Look at this picture.
  2. See the red tips.
  3. You can resize your ios simulator easy.

screen shot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文