Home > Jamf Cloud Distribution Service, Jamf Pro API, Jamf Pro Classic API, Scripting > Using the Jamf Pro API to download IPA files from a JCDS2 distribution point
A while back, I wrote about how you could use the Jamf Pro API to download installer packages from a JCDS2 distribution point.
However, installer packages are not the only items which may be stored on a JCDS2 distribution point. The IPA files used by in-house iOS, iPadOS and tvOS devices may also be stored for distribution on a JCDS2 distribution point. IPA files stored on a JCDS2 distribution point can be accessed for download in the same way that installer packages can.
For those who want to use this capability, I’ve written a script which uses the Jamf Pro Classic API and Jamf Pro API to get the list of IPA files on a Jamf Pro server, retrieve the associated download links and download the IPA files to a directory on my Mac. For more details, please see below the jump.
Pre-requisites:
If setting up a specific Jamf Pro user account for this purpose with limited rights, here are the required API privileges for the account on the Jamf Pro server:
Jamf Pro Server Objects:
For authentication, the script can accept manual input or values stored in a ~/Library/Preferences/com.github.jamfpro-info.plist file. The plist file can be created by running the following commands and substituting your own values where appropriate:
To store the Jamf Pro URL in the plist file:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To store the account username in the plist file:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.github.jamfpro-info jamfpro_user account_username_goes_here |
To store the account password in the plist file:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.github.jamfpro-info jamfpro_password account_password_goes_here |
Usage:
/path/to/Jamf_Pro_JCDS_Mobile_InHouseIPA_Download.sh
The script takes the following actions:
The script should provide output similar to this:
Downloading new copies of the IPA files where no copies currently exist:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username@computername ~ % /Users/username/Jamf_Pro_JCDS_Mobile_InHouseIPA_Download.sh | |
A location to store downloaded IPA files has not been specified. | |
Downloaded IPA files will be stored in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Please enter your Jamf Pro server URL : https://jamfpro.server.here | |
Please enter your Jamf Pro user account : apiuser | |
Please enter the password for the apiuser account: | |
/var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo exists but is empty. Using existing directory for downloading IPA files. | |
Downloading AIM 1.0.ipa to /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
######################################################################################################## 100.0% | |
AIM 1.0.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Downloading AMP 2.3.ipa to /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
######################################################################################################## 100.0% | |
AMP 2.3.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Downloading Barcodes 1.1.ipa to /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
######################################################################################################## 100.0% | |
Barcodes 1.1.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Downloading Battleship 1.0.6.ipa to /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
######################################################################################################## 100.0% | |
Battleship 1.0.6.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
username@computername ~ % |
Verifying existing copies of the IPA files exist and have MD5 hashes that match the IPA files stored in Jamf Pro:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username@computername ~ % /Users/username/Jamf_Pro_JCDS_Mobile_InHouseIPA_Download.sh | |
Please enter your Jamf Pro server URL : https://jamfpro.server.here | |
Please enter your Jamf Pro user account : apiuser | |
Please enter the password for the apiuser account: | |
AIM 1.0.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of AIM 1.0.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with AIM 1.0.ipa on https://jamfpro.server.here… | |
MD5 hash of AIM 1.0.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches AIM 1.0.ipa on https://jamfpro.server.here. | |
AIM 1.0.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
AMP 2.3.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of AMP 2.3.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with AMP 2.3.ipa on https://jamfpro.server.here… | |
MD5 hash of AMP 2.3.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches AMP 2.3.ipa on https://jamfpro.server.here. | |
AMP 2.3.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Barcodes 1.1.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of Barcodes 1.1.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with Barcodes 1.1.ipa on https://jamfpro.server.here… | |
MD5 hash of Barcodes 1.1.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches Barcodes 1.1.ipa on https://jamfpro.server.here. | |
Barcodes 1.1.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Battleship 1.0.6.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of Battleship 1.0.6.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with Battleship 1.0.6.ipa on https://jamfpro.server.here… | |
MD5 hash of Battleship 1.0.6.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches Battleship 1.0.6.ipa on https://jamfpro.server.here. | |
Battleship 1.0.6.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
username@computername ~ % |
Verifying existing copies of the IPA files exist and detecting copies that do not have MD5 hashes that match the IPA files stored in Jamf Pro:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username@computername ~ % /Users/username/Jamf_Pro_JCDS_Mobile_InHouseIPA_Download.sh | |
Please enter your Jamf Pro server URL : https://jamfpro.server.here | |
Please enter your Jamf Pro user account : apiuser | |
Please enter the password for the apiuser account: | |
AIM 1.0.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of AIM 1.0.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with AIM 1.0.ipa on https://jamfpro.server.here… | |
MD5 hash of AIM 1.0.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches AIM 1.0.ipa on https://jamfpro.server.here. | |
AIM 1.0.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
AMP 2.3.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of AMP 2.3.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with AMP 2.3.ipa on https://jamfpro.server.here… | |
MD5 hash of AMP 2.3.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches AMP 2.3.ipa on https://jamfpro.server.here. | |
AMP 2.3.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Barcodes 1.1.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of Barcodes 1.1.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with Barcodes 1.1.ipa on https://jamfpro.server.here… | |
MD5 hash of Barcodes 1.1.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo does not match Barcodes 1.1.ipa on https://jamfpro.server.here. | |
Deleting Barcodes 1.1.ipa from /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Downloading Barcodes 1.1.ipa to /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
######################################################################################################## 100.0% | |
Barcodes 1.1.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Battleship 1.0.6.ipa found in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
Checking MD5 hash of Battleship 1.0.6.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo to verify match with Battleship 1.0.6.ipa on https://jamfpro.server.here… | |
MD5 hash of Battleship 1.0.6.ipa in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo matches Battleship 1.0.6.ipa on https://jamfpro.server.here. | |
Battleship 1.0.6.ipa is available in /var/folders/zh/5bw3hvb93kdb3nwmwfjkhgsw0000gp/T/tmp.MAKKW8O0oo. | |
username@computername ~ % |
This script is available from GitHub at the following location:
A version which uses API client authentication is available from GitHub at the following location:
Both scripts can be accessed via the following link: