Skip to content

Instantly share code, notes, and snippets.

@a2
Last active September 25, 2018 12:11
Show Gist options
  • Select an option

  • Save a2/9bc24b2d93a3307ed64434ddf118045c to your computer and use it in GitHub Desktop.

Select an option

Save a2/9bc24b2d93a3307ed64434ddf118045c to your computer and use it in GitHub Desktop.

Revisions

  1. a2 revised this gist Sep 25, 2018. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions install_booted.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@ if [ "$#" -ne 1 ]; then
    exit 1
    fi

    xcrun simctl list -j devices | \
    jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid" | \
    xargs -P 10 -I __UUID__ xcrun simctl install __UUID__ $1
    APP_PATH=$1
    BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist"`
    for DEVICE in $(xcrun simctl list -j devices | jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid"); do
    xcrun simctl install $DEVICE $APP_PATH && xcrun simctl launch $DEVICE $BUNDLE_ID >/dev/null &
    done
  2. a2 renamed this gist Sep 25, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. a2 revised this gist Sep 25, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions install_all.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,6 @@ if [ "$#" -ne 1 ]; then
    exit 1
    fi

    for UDID in $(xcrun simctl list -j devices | jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid"); do
    xcrun simctl install $UDID $1
    done
    xcrun simctl list -j devices | \
    jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid" | \
    xargs -P 10 -I __UUID__ xcrun simctl install __UUID__ $1
  4. a2 revised this gist Sep 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_all.sh
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,5 @@ if [ "$#" -ne 1 ]; then
    fi

    for UDID in $(xcrun simctl list -j devices | jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid"); do
    xcrun simctl install $UDID $2
    xcrun simctl install $UDID $1
    done
  5. a2 created this gist Sep 25, 2018.
    10 changes: 10 additions & 0 deletions install_all.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/sh

    if [ "$#" -ne 1 ]; then
    echo "$0 <path>"
    exit 1
    fi

    for UDID in $(xcrun simctl list -j devices | jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid"); do
    xcrun simctl install $UDID $2
    done