如何调整 iPhone/iPad 模拟器的大小?
在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
⌘+1 为 100%
⌘+2 为 75%
⌘+3 为 50%
⌘+1 for 100%
⌘+2 for 75%
⌘+3 for 50%
使用 Xcode 9-Simulator 更加灵活。只需选择 &拖动模拟器的任意角来调整其大小并根据您的要求进行设置。
看一下这个快照:
注意:在 Xcode 9.1+ 中,模拟器缩放选项已更改。< /强>
键盘快捷键:
根据 Xcode 9.1+
根据 Xcode 9
Xcode 菜单中的模拟器缩放选项:
像素精确:调整您的尺寸模拟器到实际(物理)设备的像素,如果您的 mac 系统显示屏幕尺寸(像素)支持那么高的分辨率,否则此选项将保持禁用状态。
使用终端命令
按照以下步骤使用终端命令
Terminal
应用程序(使用 Spotlight 搜索,按⌘ + SPACE
打开 Spotlight 搜索)默认写入 ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"
您会发现模拟器规模更新。
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:
Note: With Xcode 9.1+, Simulator scale options are changed.
Keyboard short-keys:
According to Xcode 9.1+
According to Xcode 9
Simulator scale options from Xcode Menu:
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.
Using Terminal Command
Follow these steps to scale simulator using terminal commands
Terminal
app (using Spotlight search, Press⌘ + SPACE
to open spotlight search)defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"
You will find simulator scale update.
Xcode 9.x:
Simulator
Window
选项卡Physical Size
选项 (cmd + 1< /code>)
现在,如果这不能根据您的兴趣调整大小,请按照以下步骤操作:
模拟器
模拟器边缘
。这将将您的光标转换为调整大小选项(双向箭头)。根据需要更改大小
。Xcode 8 或更低版本:
https://stackoverflow.com/a/30588057/1753005
Xcode 9.x :
Simulator
Window
tabPhysical Size
option (cmd + 1
)Now if this dosen’t make size as per your interest then follow below steps :
Simulator
edge of simulator
. This will convert your cursor to resize option (Bidirectional arrow).change the size as you desire
.Xcode 8 or below :
https://stackoverflow.com/a/30588057/1753005
对于 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).
您可以这样做:
窗口>取消选中“显示设备边框”
之后,您可以自定义模拟器的宽度和长度。
如果您对其尺寸感到满意,您可以再次检查“显示设备边框”
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'
对于 XCode 10,我最终不得不这样做
,我只是找不到任何其他方法来重置缩放级别。即使使用“窗口”->“缩放”来切换缩放,也无法恢复到 100%(2042x2732 iPad 12.9 英寸)。
删除设备首选项允许模拟器再次以全分辨率打开,因此我可以拍摄应用程序商店提交所需的屏幕截图。
物理尺寸
和像素精确
选项保持灰色。For XCode 10 I ended up having to do
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
andPixel Accurate
options remain greyed out.目前,旧的缩放系统(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:
Which can be toggled with:
⌘+1
⌘+2
⌘+3
⌘+4
As seen below:
很少有实用程序可以让您将显示分辨率设置得比系统偏好设置更高。
例如,如果您需要 12.9 英寸视网膜显示屏的纵向屏幕截图,分辨率为 2048 x 2732 像素。我只需使用这些实用程序之一(例如:App Store 中的显示菜单)即可将我的 Macbook Pro 2017 Retina 显示屏设置为 3360x2100。
之后,我使用 12,9" iPad Retina 启动 Xcode 模拟器,并将模拟器大小调整到屏幕的最大尺寸。结果,我得到的分辨率正好为 2048 x 2732,可以上传到 App Store。
希望这对某人有用。
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.
Hope that is useful for someone.
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
对于 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
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