Overview:
Wallpaper setups may be time-consuming, especially when an administrator is required to make the change on several devices. As a result, we at Addigy decided to make the procedure a little easier by offering a variety of alternatives based on your operating system.
This post will go over the numerous custom scripts that may be executed on your device to change the wallpaper. The script will report back all the devices that fall within your defined policy (report back Device Name and Agent ID), interpret the results, and conduct the API Request for the wallpaper change.
The scripts discussed in this article are attached in the footer.
General Requirements:
- iOS and iPadOS Supervised Devices
- Requires iOS 8.0+
- Requires Addigy MDM
- An Addigy API V2 KEY
- Policy ID of the Policy the command will be sent to
Catalog
Applying the Wallpaper in Python:
MacOS Operating system:
This will require the Python Interpreter from the Homebrew Library:
-
Install Homebrew your macOS - HomeBrew Installation (if installed, skip this)
Once homebrew is installed, Installpython3with Homebrew (if installed, skip this):brew install python -
Once installed, Confirm the
python3version with the following command:python3 --version - Once you have the interpreter installed, we recommend downloading an IDE (Integrated development environment) to perform the editing process and execution of the script. (Example: Visual Studio Code Download)
Windows Operating system:
This will require the Python Interpreter from the Python website:
- Install the Python Interpreter from the Website - Python Download
-
Once installed, Confirm the
pythonversion with the following command:python --version - Once you have the interpreter installed, we recommend downloading an IDE (Integrated development environment) to perform the editing process and execution of the script. (Example: Visual Studio Code Download)
Once the script requirement has been met, you can successfully open the Python file in your IDE and configure all the necessary steps like:
-
- Provide the API V2 KEY
- Policy ID (Where your devices are being enrolled)
-
Set where variable for Background image (Values: 1 = Lock Screen 2 = Home Screen 3 = Both)
- By default, it will be set to 3 for both the home screen and lock screen
- The imagePath Variable will take into account your Image File Path for your wallpaper
- Once added, you should be good to go in executing the Python script - How to run Python code in Visual Studio Code
This Python script automates the process of updating wallpapers on Apple devices managed through Addigy. In simple terms, it:
Prepares a file – It creates (or clears) a CSV file to track devices and wallpaper update results.
Encodes an image – Converts the chosen wallpaper image into a format that can be sent to devices.
Fetches device information – Connects to Addigy’s API to get a list of devices under a specific policy, along with their details like name, serial number, model, and agent ID.
Applies the wallpaper – For each device (iPhone or iPad), it sends the encoded image to the device via Addigy’s API, either to the lock screen, home screen, or both.
Logs the results – Records whether the wallpaper update was successful or failed for each device in the CSV file, along with key device details.
Essentially, this script streamlines what would otherwise be a manual process of updating wallpapers on multiple devices, while keeping a clear record of success and failure.
Applying the Wallpaper in Bash
NOTE: As of macOS Sequoia (macOS 15), the jqcommand-line utility is pre-installed by default. You can verify its presence and check the version by running the following command above.
-
MacOS Operating System:
- Bash is the default shell in macOS, so an interpreter is not needed since the macOS should have one integrated with it.
- This will also require a particular library or tool called
jqfor JSON parsing that would have to be installed with Homebrew:- Install Homebrew into your macOS - HomeBrew Installation (if installed, skip this)
-
Once Homebrew is installed, Install
jqtool with Homebrew (if Installed, skip this)brew install jq -
After installation, you can verify that
jqis installed by running:jq --version
Once the script requirement has been met and downloaded, you can successfully open the shell file in your IDE or TextEdit and configure all the necessary steps:
-
- Provide the API V2 KEY
- Policy ID (Where your devices are being enrolled)
-
Set where variable for Background image (Values: 1 = Lock Screen 2 = Home Screen 3 = Both)
- By default, it will be set to 3 for both the home screen and lock screen
- The imagePath Variable will take into account your Image File Path for your wallpaper
-
Once all configurations have been configured, kindly open your terminal or IDE Terminal (How to open terminal in Visual Studio Code) to execute the script. The script can be run by executing the following:
- Convert the script into an executable by executing the following command where the script was downloaded and saved:(chmod +x FILENAME.sh)
-
Once the script has been converted to an executable,
you
can safely execute the script:
sudo sh FILENAME.sh
This Bash script automates changing wallpapers on Apple devices managed through Addigy. In simple terms, it:
Prepares a CSV file – Creates or clears a file to track devices and whether the wallpaper update succeeds.
Encodes the wallpaper image – Converts the chosen image into a format that can be sent to devices.
Fetches device information – Calls Addigy’s API to get a list of devices under a specific policy, including details like device name, serial number, model, and agent ID.
Applies the wallpaper – For each iPhone or iPad, it sends the image to the device via Addigy’s API, targeting the lock screen, home screen, or both.
Logs the results – Records the success or failure of each wallpaper update in the CSV file along with device details.
Essentially, it simplifies the repetitive task of updating wallpapers on multiple devices while keeping a clear record of what worked and what didn’t.
Additional Information
- The script must be used carefully as it will set the wallpaper on all iOS Devices within your specified policy.
- The data string on the device list endpoint on both scripts called per page quantity is set to 300 but can be changed if needed.
- The script will contain your API V2 Key, so do not share them publicly.