Created
November 23, 2016 18:11
-
-
Save Gerst20051/8ca49d5afbf09007b3696fab6e9f425c to your computer and use it in GitHub Desktop.
Copy Latest Simulator App To Desktop Bash Script
This file contains hidden or 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 | |
DESTINATION_DIR="$HOME/Desktop" | |
APP_PATH=$(find ~/Library/Developer/CoreSimulator/Devices/*/data/Containers/Bundle/Application/*/*.app -type d -maxdepth 0 -print0 | xargs -0 ls -td | head -n1) | |
APP_DIRNAME=$(dirname "$APP_PATH") | |
APP_BASENAME=$(basename "$APP_PATH") | |
FILE_EXTENSION="${APP_BASENAME##*.}" | |
FILE_NAME="${APP_BASENAME%.*}" | |
cd "$APP_DIRNAME" | |
zip -qr "$DESTINATION_DIR/$FILE_NAME.zip" "$APP_BASENAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment