When pressed Command-S, the iOS simulator always saves screenshots on Desktop. How can I tell it to save it somewhere else?
2 Answers
[Edit to add Automator steps]
You can't change the location, but I often use a little script like this to keep things tidy:
#!/usr/bin/env bash
destination=~/screenshots
while [ true ]; do
if [ -n "$(shopt -s nullglob; echo ~/Desktop/Simulator\ Screen\ Shot*.png)" ]; then
mv -v ~/Desktop/Simulator\ Screen\ Shot*.png "$destination";
fi
sleep 5
done
Since you're using the iOS simulator you probably know how to create this as an executable script already, so I'll avoid giving those instructions.
If not, I might use Automator.
- Create folder screenshots in your home directory
- Start Automator and create a new Document of type Application
- Find the Run Shell Script action and drag it from the actions on the left to the workspace on the right
- Paste the shell script without the first line with #! stuff
- Save it and run it from applications
- You should see the screen shot files be moved.
- Here's a visual. http://www.screencast.com/t/KEbAFifHCTcc
-
Thank you! Actually I stick to xcode and spend as little time as possible with the Terminal app. Basically save as .command and run, right?– sanjihanFeb 23, 2016 at 22:15
-
Cool, since that is the case, I might use Automator. - Create folder screenshots in your home directory - Start Automator and create a new Document of type Application - Find the Run Shell Script action and drag it from the actions on the left to the workspace on the right - Paste the shell script without the first line with #! stuff - Save it and run it from applications - You should see the screen shot files be moved. - Here's a visual. screencast.com/t/KEbAFifHCTcc Feb 24, 2016 at 23:43
-
If you choose Folder Action when making the Automator document, you can attach this to the Desktop folder, and macOS will run the script in the background automatically. Remove the
while
,sleep
, anddone
lines from the script - the system will take care of that– henryMar 8, 2018 at 18:56