From 3c80097cce0c4e193cfbd8bd0a191e3f6b92e135 Mon Sep 17 00:00:00 2001 From: Emre Biberoglu Date: Fri, 17 Mar 2023 12:50:21 -0500 Subject: [PATCH] adding a script to install VPP apps (#865) --- tools/api/commands/install_vpp_application | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/api/commands/install_vpp_application diff --git a/tools/api/commands/install_vpp_application b/tools/api/commands/install_vpp_application new file mode 100644 index 00000000..d693a772 --- /dev/null +++ b/tools/api/commands/install_vpp_application @@ -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@- \ No newline at end of file