iOS 模拟器截图存储在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8286120/
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
Where are iOS simulator screenshots stored?
提问by Flyingkiwi
I have saved some screenshots in the iPhone Simulator running iOS 5, but I can't find them.
我在运行 iOS 5 的 iPhone 模拟器中保存了一些屏幕截图,但我找不到它们。
I had this problem before, and it took me frickin' ages to find them in the file system. Is this so simple that I am just a dullard, or does no-one use this feature or what?
我以前遇到过这个问题,我花了很长时间才在文件系统中找到它们。是不是这么简单以至于我只是一个笨蛋,还是没有人使用这个功能还是什么?
I know I can get the screenshots off my real phone, but I don't want retina screenshots - I want normal screenshots.
我知道我可以从我的真实手机上获取屏幕截图,但我不想要视网膜屏幕截图 - 我想要普通屏幕截图。
回答by Michael Dautermann
If you create screenshots from within the simulator using File -> Save Screen Shot (Command-S), those files end up on the Desktop as something like:
iOS Simulator Screen shot Apr 22, 2012.png
.Under Xcode 6 & newer, device screenshots taken with the "Take Screenshot" button in the Xcode "Devices" menu will end up on the desktop. Look for a file named "
Screen Shot 2014-MM-DD at HH.MM.SS.png
"For Xcode 5 & older, if you create screenshots from within Xcode (Organizer), you'll find these in
~/Library/Application Support/Developer/Shared/Xcode/Screenshots
. To take screenshots from the Xcode (Organizer) you need to have hardware device attached. The organizer does not appear to take screenshots from the simulator.
如果您使用 File -> Save Screen Shot (Command-S) 从模拟器中创建屏幕截图,这些文件最终会在桌面上显示为:
iOS Simulator Screen shot Apr 22, 2012.png
.在 Xcode 6 及更新版本下,使用 Xcode“设备”菜单中的“截屏”按钮截取的设备屏幕截图将显示在桌面上。查找名为“
Screen Shot 2014-MM-DD at HH.MM.SS.png
”的文件对于 Xcode 5 及更早版本,如果您从 Xcode (Organizer) 中创建屏幕截图,您将在
~/Library/Application Support/Developer/Shared/Xcode/Screenshots
. 要从 Xcode (Organizer) 截取屏幕截图,您需要连接硬件设备。组织者似乎不会从模拟器中截取屏幕截图。
And outside of Xcode:
在 Xcode 之外:
If you create screenshots using the Finder (command-shift-3 or command-shift-4), these also end up on the Desktop as something like: "Screen Shot 2012-04-22 at _AM.png"
If you use the Grab application (found in
/Application/Utilities
), you can save those files anywhere you decide. :-)If you have saved a screenshot to the Photos library from within your app, for example with UIGetScreenImage and UIImageWriteToSavedPhotosAlbum, they end up at
~/Library/Application Support/iPhone Simulator/***version***/Media/DCIM/100APPLE
如果您使用 Finder(command-shift-3 或 command-shift-4)创建屏幕截图,这些屏幕截图也会在桌面上显示为:“Screen Shot 2012-04-22 at _AM.png”
如果您使用 Grab 应用程序(可在 中找到
/Application/Utilities
),您可以将这些文件保存在您决定的任何位置。:-)如果你已经从你的应用程序中将屏幕截图保存到照片库,例如使用 UIGetScreenImage 和 UIImageWriteToSavedPhotosAlbum,它们最终会在
~/Library/Application Support/iPhone Simulator/***version***/Media/DCIM/100APPLE
回答by Udo
They get saved to the Desktop, look for a PNG file with the naming convention "iOS Simulator Screen shot [DATE].png"
它们被保存到桌面,查找命名约定为“iOS Simulator Screen shot [DATE].png”的 PNG 文件
回答by Claus Broch
In the Organizer view just right-click a screenshot and select "Show in Finder...".
在管理器视图中,只需右键单击屏幕截图并选择“在 Finder 中显示...”。
This will open the screenshots folder in the Finder for you.
这将为您打开 Finder 中的屏幕截图文件夹。
回答by Wayne Liu
It looks like the most recent Xcode (I'm using v4.2.1) does have a bug saving screen shots from the iOS simulator. Even after press File > Save Screen Shot, I can't find any image files on the Desktop. Recently, I noticed this awesome software iOS-Simulator Cropper. It allows you to capture images from the simulator with different settings.
看起来最新的 Xcode(我使用的是 v4.2.1)确实有一个从 iOS 模拟器保存屏幕截图的错误。即使按文件 > 保存屏幕截图,我在桌面上也找不到任何图像文件。最近,我注意到了这个很棒的软件iOS-Simulator Cropper。它允许您使用不同的设置从模拟器中捕获图像。
回答by railwayparade
Alternatively if you are experiencing the bug you can use Edit->Copy Screen to copy to the clipboard.
或者,如果您遇到错误,您可以使用 Edit->Copy Screen 复制到剪贴板。
回答by Hendrik
They are stored in:
它们存储在:
~/Library/Application\ Support/Developer/Shared/Xcode/Screenshots
I like putting them in my Dropbox to have them on my other devices too.
我喜欢将它们放在我的 Dropbox 中,以便将它们也放在我的其他设备上。
cd ~/Library/Application\ Support/Developer/Shared/Xcode/
mkdir ~/Dropbox/Pictures/xcode/
mv Screenshots/* ~/Dropbox/Pictures/xcode/
rm -rf Screenshots
ln -sf ~/Dropbox/Pictures/xcode/ Screenshots
This will create a symbolic link to your Dropbox in Pictures/xcode
这将在 Pictures/xcode 中创建一个指向 Dropbox 的符号链接
回答by user1357607
I had exactly the same problem but I found that although (Command+s) didn't save the image to the desktop (Command+Ctrl+C) did copy the screenshot to the clipboard. You can then open and save the screenshot using Preview.
我遇到了完全相同的问题,但我发现虽然 (Command+s) 没有将图像保存到桌面 (Command+Ctrl+C) 确实将屏幕截图复制到剪贴板。然后,您可以使用预览打开并保存屏幕截图。
回答by Izzy Manpo
I find a very useful way to find them is to use the spotlight search shortcut CMD+Spacethen enter the text "screen shot" or "ios simulator screen shot"
我发现找到它们的一个非常有用的方法是使用聚光灯搜索快捷方式CMD+Space然后输入文本“屏幕截图”或“ios模拟器屏幕截图”
If it's not in the initial search screen, you can always use the Show All In Finderoption that's first in the list
如果它不在初始搜索屏幕中,您始终可以使用列表中第一个的“在 Finder 中显示全部”选项
Not only does this work first time, every time, but it also reminds me when I've forgotten where I've moved previous screen shots to :)
这不仅是第一次,每次都有效,而且当我忘记将以前的屏幕截图移到哪里时它还会提醒我:)
回答by Saad Ur Rehman
Change the device: Hardware>Device>iPhone(Retina 4-inch)
更换设备:Hardware>Device>iPhone(Retina 4-inch)
Press Command + S
按 Command + S
Screenshot will automatically come on your desktop
屏幕截图将自动出现在您的桌面上
回答by Krunal
With Xcode 9+, Simulator saves screen shot file on (logged-in user's) Desktop
and it's default path.
使用 Xcode 9+,模拟器将屏幕截图文件保存在(登录用户的)上Desktop
,并且是默认路径。
To change default path (with Xcode 9+), press and hold ? Option(alt) button from keyboard, while you take a screen shot. It will show to a dialog with file storage options and also allows to set/change default path.
要更改默认路径(使用 Xcode 9+),请按住? Option键盘上的 (alt) 按钮,同时进行屏幕截图。它将显示一个带有文件存储选项的对话框,还允许设置/更改默认路径。