Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Created November 23, 2016 18:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gerst20051/8ca49d5afbf09007b3696fab6e9f425c to your computer and use it in GitHub Desktop.
Save Gerst20051/8ca49d5afbf09007b3696fab6e9f425c to your computer and use it in GitHub Desktop.
Copy Latest Simulator App To Desktop Bash Script
#!/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