Last active
May 19, 2016 08:32
-
-
Save DylanLacey/8ef50aac28c7dc331f89 to your computer and use it in GitHub Desktop.
DoThePhotoThing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#! /bin/bash | |
# Wait until the simulator is running before we try to add the file | |
simulator=$(ps aux | grep launchd_sim | grep -v grep) | |
while [ -z "$simulator" ] | |
do | |
echo Sleeping for 5 | |
sleep 5 | |
simulator=$(ps aux | grep launchd_sim | grep -v grep) | |
done | |
# Parse out the simulator in use | |
device=$(echo $simulator | sed -n 's_^.*/Users/.*/CoreSimulator/Devices/\([0-9A-Z-]*\).*_\1_p') | |
# Fetch the file | |
wget -P ./ http://i.imgur.com/58mXgoU.jpg | |
# Put it on the simulator | |
echo Upload file to simulator $device | |
/Applications/Xcode-6.1.app/Contents/Developer/usr/bin/simctl addphoto $device 58mXgoU.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@DylanLacey ok this works, but how do i remove the stock photos already present?