简体   繁体   English

如何更改iOS Simulator保存屏幕快照的目录?

[英]How to Change Directory where iOS Simulator Saves Screenshots?

When saving a screenshot from the iOS Simulator, the screenshots are saved to the Desktop 从iOS模拟器保存屏幕截图时,屏幕截图会保存到桌面

After taking a few, my Desktop is quickly polluted with screen shots that don't belong there. 拍摄了几张之后,我的桌面很快就被不属于该屏幕的屏幕快照污染。

How does one change the directory where iOS Simulator screenshots are saved? 如何更改iOS Simulator屏幕快照的保存目录?

In some issue related to where screenshot gets stored, a commenter responded that 'by default' they get stored on the desktop (implying it could be changed). 在与屏幕快照存储位置有关的一些问题中,评论者回答说“默认情况下”它们存储在桌面上(暗示可以更改)。

(iOS Simulator 8.0, Xcode 6.0.1, Mac OS X 10.9.5) (iOS模拟器8.0,Xcode 6.0.1,Mac OS X 10.9.5)

EDIT: iOS Simulator custom screenshot directory support added in Xcode 9 beta 编辑: 在Xcode 9 beta中添加了iOS Simulator自定义屏幕快照目录支持

The iOS Simulator does not currently have an option to change the default screenshot directory. iOS Simulator当前没有更改默认屏幕快照目录的选项。

Please duplicate my bug report! 请复制我的错误报告! http://bugreport.apple.com http://bugreport.apple.com

rdar://26127809
Allow iOS Simulator to specify a non-Desktop directory for CMD-S screenshots.

In the mean time, I use the app Hazel to automatically move iOS Simulator screenshots (taken via ⌘S) from the default Desktop location to my Simulator Screenshots folder. 同时,我使用Hazel应用程序将iOS模拟器屏幕截图(通过⌘S获取)从默认桌面位置自动移动到我的模拟器屏幕截图文件夹。

Hazel watches whatever folders you tell it to, automatically organizing your files according to the rules you create. Hazel会监视您告诉它的所有文件夹,并根据创建的规则自动组织文件。

http://www.noodlesoft.com/hazel.php http://www.noodlesoft.com/hazel.php

榛树界面。

Xcode 9 adds behavior for setting a custom directory for iOS Simulator screenshots. Xcode 9添加了用于为iOS Simulator屏幕截图设置自定义目录的行为。

Press ⌥⌘S or Hold the ⌥ Option key and select the menu item: ⌥⌘S按住 ⌥Option ,然后选择菜单项:

File > New Screen Shot...

This presents a file "Save As..." dialog. 这将显示一个文件“另存为...”对话框。 Note the new checkbox on the dialog: 请注意对话框上的新复选框:

Use this as the default location 使用它作为默认位置

Check that checkbox to change the default directory for ⌘S iOS Simulator screenshots. 选中该复选框以更改⌘SiOS Simulator屏幕截图的默认目录。

“新屏幕截图...”的菜单项

“将其用作默认位置”复选框

Following on from: https://stackoverflow.com/a/44810443/14868 从以下继续: https : //stackoverflow.com/a/44810443/14868

As of Xcode 9 , you can also set the output folder using the defaults command and integrate it with any machine setup you use. Xcode 9开始 ,您还可以使用defaults命令设置输出文件夹,并将其与您使用的任何计算机设置集成。

Example: 例:

defaults write com.apple.iphonesimulator ScreenShotSaveLocation "$HOME/Screen Shots"

You will not be able to do that. 您将无法执行此操作。

An easy alternative could be: 一个简单的替代方法可能是:

  1. press cmd+shft+4 按cmd + shft + 4
  2. press spacebar 按空格键
  3. Click your iPad/iPhone simulator window 单击您的iPad / iPhone模拟器窗口

with changing the default screenshot directory: Change the Screen Shot Save File Location in Mac OS X 更改默认屏幕快照目录的步骤: 在Mac OS X中更改屏幕快照保存文件的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM