Change the Location of Screen Shots Saved by the iOS Simulator
Solution 1
In Xcode 12 we now always set the default location to wherever you last saved a screenshot, so to change the default location press ⌥ + ⌘ + S then select the location.
Also new to Xcode 12 you can right-click on the screenshot preview window that appears and you should see Desktop, Documents, and your custom location (if you've set one that isn't the Desktop). So even if the default is somewhere else you can always send the screenshot to the Desktop. You can also drag this window and drop it in an app or the Finder.
In Xcode 9 you can hold down Option while saving a screenshot and we will prompt you for the location. Check the "Use this as the default location" box to make the selected directory the default for all screenshots.
Solution 2
Simulator saves screen shot file on (logged-in user's) desktop and it's default path.
To change default path (with Xcode 9+), press and hold ⌥ Option (alt) button from keyboard, while you take a screen shot.
Or
Using Mac Keyboad: Press keys ⌥ Option + ⌘ + s all together.
It will show a dialog with file storage options and also allows to set/change default path.
Solution 3
Just use MacOS defaults =)
#Read current value:
defaults read com.apple.iphonesimulator ScreenShotSaveLocation
#Set path to ~/Pictures/_screenshots:
defaults write com.apple.iphonesimulator ScreenShotSaveLocation -string ~/Pictures/_screenshots
Solution 4
I use Automator. It's easy and free.
Solution 5
It can easily be done using the new command line interface (since Xcode 8.2)
xcrun simctl io booted screenshot ~/Desktop/screenshot.png
Replace ~/Desktop/screenshot.png
with your folder location and it will be saved on there.
Further information in this blog: https://medium.com/@hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f#.bzuaf5gp0
George WS
Coding in class, studying SICP over breaks, and working on iOS apps whenever I can.
Updated on June 11, 2022Comments
-
George WS about 2 years
I'd like to change the location that screenshots created via File > Save Screen Shot in the iOS Simulator are saved from the desktop to a folder of my choice. How can this be done? Perhaps there's a user defaults value I could change, much like the one specifying the location of standard screenshots on OS X?
-
George WS over 9 yearsWell yes. I was hoping to find a way to change the save location of the actual simulator screenshots taken at the appropriate resolution and excluding the surrounding window, but given that this is as close as it seems possible to get at the moment, I'll mark it as the answer until and unless something changes or something better comes along.
-
Ben Morrow almost 8 yearsThis worked great. I had never used a Folder Action before. So for those who don't know--you just save this configuration in Automator. It runs in the background. The next time that Desktop receives a screenshot it will be moved to your other folder after a few seconds.
-
Ammo Goettsch almost 7 yearsSolved by XCode 9, see answer by russbishop
-
Ammo Goettsch almost 7 yearsThis is a perfect answer, now that it is possible to do this via XCode UI
-
Rudolf Adamkovič over 6 yearsThis is amazing! Thanks for sharing.
-
George WS about 4 yearsNote: it seems this behavior changed slightly somewhere along the way. With Xcode 11.5 I'm not seeing a "Use this as the default location" option. (Now there is an "Apply device mask to screenshot" option in its place.) However, whatever directory I choose in that dropdown still seems to become the default.
-
Alex Buznik about 2 yearsDoes not seem to work anymore