ios 在 Xcode 中截取屏幕截图

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

Taking screenshots in Xcode

iosxcodeios-simulator

提问by Tsvetilin Boynovski

I am currently trying to take screenshots of my app in order to publish it to the App Store.

我目前正在尝试截取我的应用程序的屏幕截图,以便将其发布到 App Store。

The problem is when I take a screenshot on the iPhone 6S simulator (4,7 inch) and upload it to the iTunes Connect it says the dimensions are too small (375x667) and they are required to be at least 750x1334.

问题是当我在 iPhone 6S 模拟器(4,7 英寸)上截取屏幕截图并将其上传到 iTunes Connect 时,它说尺寸太小(375x667)并且它们必须至少为750x1334

Am I taking the screenshots the wrong way or is my Xcode simulator incapable of taking screenshots at high dimensions?

我是否以错误的方式截取屏幕截图,还是我的 Xcode 模拟器无法在高维度上截取屏幕截图?

采纳答案by Tsvetilin Boynovski

Just did it. You have to set the scale to 100% first and than take the screenshot.

刚刚做到了。您必须先将比例设置为 100%,然后才能截取屏幕截图。

回答by Edess Elder

Try this one! The screenshots are saved on the Desktop.

试试这个!屏幕截图保存在桌面上。

enter image description here

在此处输入图片说明

回答by Naderio

When running in simulator, pressing CMD+Ssaves a Screenshot of the active simulator to the Desktop.

在模拟器中运行时,按CMD+S将活动模拟器的屏幕截图保存到桌面。

With a real device connected and focus to the Xcode window you can click the menu
Debug> View Debugging> Take Screenshot of [Devicename]
This Screenshot is saved to the Desktop too.

连接真实设备并聚焦到 Xcode 窗口后,您可以单击菜单
Debug> View Debugging>Take Screenshot of [Devicename]
此屏幕截图也保存到桌面。

回答by Franck

Press Command - S, you will get screenshot in the same size of the actual sim device.

按 Command - S,您将获得与实际 sim 设备相同大小的屏幕截图。

Also, If you want to generate nice screen shot sor App Store, I use this web site (https://launchkit.io/). (Free version)

另外,如果你想生成漂亮的屏幕截图或 App Store,我使用这个网站 ( https://launchkit.io/)。(免费版)

回答by GLee

You also need to uncheck "Optimize Rendering for Window Size" on the simulator: enter image description here

您还需要在模拟器上取消选中“Optimize Rendering for Window Size”: 在此处输入图片说明

Steps to get correctly sized screenshots for the app store:

为应用商店获取正确大小的屏幕截图的步骤:

  1. Open the app in the simulator (6s Plus is 5.5")
  2. Uncheck "Optimize Rendering for Window Size" on the simulator.
  3. Press Cmd+1 to set size to "Physical Size"
  4. Press Cmd+S to save a screenshot to desktop.
  1. 在模拟器中打开应用程序(6s Plus 为 5.5")
  2. 在模拟器上取消选中“优化窗口大小的渲染”。
  3. 按 Cmd+1 将大小设置为“物理大小”
  4. 按 Cmd+S 将屏幕截图保存到桌面。

回答by ryan0

None of these things worked for me. My problem was that I was not using the iPhone X simulator to take the screenshots. Cmd + sworked once I switched.

这些东西都不适合我。我的问题是我没有使用 iPhone X 模拟器来截屏。 Cmd + s一旦我切换就工作了。

回答by Arush

Have you used the Simulator menubar option to capture the screenshot !

您是否使用过模拟器菜单栏选项来捕获屏幕截图!

回答by Darshit Shah

Set Xcode shortcut from Preferences...for the screenshot of the active device.

从 Preferences...设置Xcode 快捷方式以获取活动设备的屏幕截图。

Go to Xcode >> Preferences... >> Key Bindings >> View Debugging-Take Screenshot of Active Device (Debug Menu) >> Set your custom shortcut.

转到 Xcode >> Preferences... >> Key Bindings >> View Debugging-Take Screenshot of Active Device(调试菜单)>> 设置您的自定义快捷方式。

Set your custom shortcut, I set ctrl+cmd+alt+S

设置你的自定义快捷方式,我设置了ctrl+cmd+alt+S