index all rss twitter github linkedin email

Álvaro Ramírez

12 November 2017 iOS dev command-line goodies

Install ipa on device

Get utility with:

npm install -g ipa-deploy
npm install -g ios-deploy

Install ipa on connected iPhone:

ipa-deploy path/to/your/App.ipa

Install app on booted simulator

Install ipa on connected iPhone:

xcrun simctl install booted path/to/your/App.app

Install ipa on booted simulator

#!/bin/bash

# Unzip ipa, install app, and run on booted simulator.

set -o nounset
set -o errexit

readonly IPA_PATH=$1
readonly TEMP_DIR_PATH=$(mktemp -d)
readonly BASENAME=$(basename ${IPA_PATH})
readonly NAME=${BASENAME%.*}
readonly APP_DIR_PATH="${TEMP_DIR_PATH}/Payload/${NAME}.app"
readonly PLIST_FILE_PATH="${APP_DIR_PATH}/Info.plist"

trap "rm -rf ${TEMP_DIR_PATH}" EXIT

unzip -o "${IPA_PATH=}" -d "${TEMP_DIR_PATH}"

readonly BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" ${PLIST_FILE_PATH})

xcrun simctl install booted "${APP_DIR_PATH}"
xcrun simctl launch booted "${BUNDLE_ID}"