adding a script to install VPP apps (#865)

This commit is contained in:
Emre Biberoglu
2023-03-17 12:50:21 -05:00
committed by GitHub
parent 86e5d91348
commit 3c80097cce

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Install VPP application on device
# VPP app needs to be registered with the device serial number using the apple endpoint (https://vpp.itunes.apple.com/mdm/v2/assets/associate) before one can install it on a device
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "InstallApplication" \
--arg udid "$1" \
--arg itunes_store_id $2 \
'.udid = $udid
|.request_type = $request_type
|.itunes_store_id = ($itunes_store_id|tonumber)
|.options = {"purchase_method": 1}
'|\
curl $CURL_OPTS \
-H "Content-Type: application/json" \
-K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@-