如何在iPhone Simulator中按真机方式截屏且不保存至桌面?
Great question! The good news is that modern iPhone Simulator versions (Xcode 13 and later) support a near-identical screenshot workflow to real iPhones—including the thumbnail preview and share sheet with extension support you need. Here's exactly how to do it:
Step-by-Step Guide
- First, make sure your app (with embedded Share Extension) is installed and running in the Simulator. Launch it just like any other test app.
- To trigger the screenshot:
- Use the keyboard shortcut
Cmd + Shift + 4, then press the Space bar—your cursor will turn into a camera icon. Click directly on the Simulator window to capture a device-sized screenshot. - Alternatively, use the Simulator menu bar: go to
Edit > Take Screenshot(this works identically to the shortcut).
- Use the keyboard shortcut
- Right after capturing, you’ll see the screenshot thumbnail pop up in the bottom-left corner of the Simulator window—exactly like on a real iPhone.
- Tap the thumbnail to open the screenshot editor. Look for the share icon (square with an upward arrow) in the bottom-left corner of this editor.
- Tap the share icon to bring up the share sheet, and your Share Extension should appear as an option here (assuming your extension’s activation rules are configured correctly to handle image content).
Key Notes
- This workflow only works in Xcode 13 and newer. Since you’re updating Xcode right now, you’ll have full access to this feature once the update finishes.
- Double-check your Share Extension’s
Info.plistconfiguration: ensure theNSExtensionActivationRuleis set to accept image types (likepublic.image) so it shows up in the share sheet for screenshots. - If the thumbnail doesn’t appear right away, try closing and re-launching the Simulator—sometimes a quick restart fixes minor glitches with the screenshot system.
内容的提问来源于stack exchange,提问作者Josh O'Connor
相关产品推荐
相关产品推荐

