Skip to main content

Deploying Swif Silently on Mac/macOS Machines

Overview

The Swif silent installer for macOS simplifies the process of enrolling devices into Swif's management system and removing existing MDM profiles. This guide outlines the steps to retrieve required configurations, prepare the installer, and deploy it silently on macOS devices.


Important Note: Silent Installer Does Not Support BYOD Enrollment

The Swif silent installer for macOS is designed for corporate-owned devices and does not support Bring Your Own Device (BYOD) enrollment. Ensure that all devices being enrolled using the silent installer are organization-owned.


Important Notes about Existing MDM Profiles

  • After installation, the Swif Agent checks every 10 minutes for existing MDM profiles:

    • It will automatically attempt to remove any existing non-Swif MDM profiles using admin permissions, typically without requiring a removal password.

    • If an Identifier and Removal Key are provided (optional), the Agent will additionally attempt to use this combination to remove existing MDM profiles.

    • Swif does not detect or remove any existing agents, services, or apps related to other MDM providers.

  • DEP-Protected Devices:
    If your device is enrolled in Apple's Automated Device Enrollment (DEP), please check the DEP profile configuration:

    • If the DEP profile is set to removable, the Swif Agent will automatically remove it.

    • If the DEP profile is set to non-removable, the Swif Agent cannot remove it. In this case, you must manually remove the device from your existing MDM provider before enrolling in Swif.


When an Existing MDM Profile Cannot Be Removed

The Swif silent installer attempts to remove an existing third-party MDM enrollment profile before enrolling the Mac in Swif. However, macOS permits only one active MDM enrollment at a time, and Swif cannot remove a profile that the previous MDM provider configured as non-removable.

When this occurs, Swif enrollment may fail with the following message:

Profile installation failed.
Your computer is already enrolled with an MDM server. It can be enrolled with only one MDM server at a time.

This commonly affects Macs enrolled through Apple Business Manager using Automated Device Enrollment, formerly called Device Enrollment Program or DEP. Automated Device Enrollment allows the previous MDM provider to prevent users, local administrators, and command-line tools from removing its enrollment profile. An MDM profile identifier or removal key cannot override this protection.

Apple documents this behavior under Automated Device Enrollment and device management.

Check Whether the Existing Profile Is Removable

  1. On the Mac, open System Settings.

  2. Go to General > Device Management.

  3. Select the existing MDM enrollment profile.

  4. Check whether the Unenroll or remove () control is available.

If the remove control is disabled, the profile cannot be removed locally. The Swif silent installer will continue trying to remove the profile, but macOS will reject the request.


Remove the Existing MDM Enrollment

Use one of the following methods.

Method 1: Unenroll the Mac Through the Existing MDM Provider

Use the previous provider’s administration console—such as Jamf, Jamf Now, Mosyle, or another MDM service—to send an unenrollment or profile-removal command to the Mac.

If the previous provider successfully removes the enrollment profile, you normally do not need to erase the Mac.

After unenrollment:

  1. Confirm that the previous MDM profile no longer appears under System Settings > General > Device Management.

  2. Confirm that the previous provider’s MDM enrollment has been removed.

  3. Run or redeploy the Swif silent installer.

  4. Verify that the Mac enrolls in Swif.

Contact the previous MDM provider or administrator if you cannot send the unenrollment command.

Important: Swif removes only the existing MDM enrollment profile when macOS permits it. Swif does not automatically remove applications, agents, services, scripts, or other components installed by the previous MDM provider.

Method 2: Reassign the Mac in Apple Business Manager and Erase It

Use this method when the previous MDM provider cannot remotely unenroll the Mac or when you want the device to use Automated Device Enrollment with Swif.

  1. In Apple Business Manager, reassign the Mac from the previous MDM server to the MDM server used for Swif.

  2. Synchronize the device assignment with the applicable MDM service.

  3. Confirm that the Mac has received the correct Automated Device Enrollment assignment.

  4. Back up any required user data.

  5. Erase the Mac.

  6. Complete Setup Assistant and enroll the Mac using its new assignment.

Erasing the Mac deletes its local data. Confirm that required files, recovery keys, activation-lock information, and application data have been preserved before proceeding.

Important: Reassigning the Mac to another MDM server in Apple Business Manager is generally preferable to releasing it from the organization. Releasing a device is intended for devices the organization no longer owns and may be irreversible.

If the Mac Re-enrolls in the Previous MDM After an Erase

The Mac may still be assigned to the previous MDM server in Apple Business Manager.

Before erasing it again:

  1. Locate the Mac by serial number in Apple Business Manager.

  2. Reassign it to the correct MDM server.

  3. Confirm that the new assignment has synchronized.

  4. Erase and reactivate the Mac.

If the assignment is not changed, Automated Device Enrollment can enroll the Mac in the previous MDM again during Setup Assistant.


How to use silent installer

Step 1: Retrieve old MDM's Identifier and Removal Key (Optional - Needed when you have an existing MDM)

Before downloading the silent installer, you need to retrieve and save the identifier and removal key of the existing MDM profile in the Swif configuration area. These values are required when the MDM profile is password-protected, as the removal key serves as the profile's password.

Retrieve the Identifier of the Existing MDM Profile

  1. Open the Terminal application.

  2. Run the following command to list all profiles and extract detailed information in XML format:

    sudo /usr/bin/profiles list -output stdout-xml
  3. Locate the enrollment profile in the output by finding the PayloadType key with the value com.apple.mdm:

    <key>PayloadType</key> 
    <string>com.apple.mdm</string>
  4. Identify the identifier under the <key>PayloadIdentifier</key> tag:

    <key>PayloadIdentifier</key> 
    <string>com.companyname.mdm</string>
    • In this example, the identifier is com.companyname.mdm.

Removal Key

  • The removal key is the password associated with the MDM profile. This is necessary to remove profiles that are password-protected. If you don’t know the removal key, you may need to contact the previous MDM provider or your IT administrator.

Save the Identifier and Removal Key

  • Save the retrieved identifier and removal key in the Swif configuration area under the silent installer tab. This step is necessary before proceeding to the installer download.


Step 2: Download the Silent Installer

You can download the silent installer directly from the Swif admin dashboard. However, macOS may flag browser-downloaded files as potentially unsafe. To avoid this, we recommend using the CURL command in the Terminal to download the installer securely.

Use CURL to Download the Installer

Run the following command in your Terminal to download the installer:

curl -OL https://cdn.swifteam.com/st-agent-ui/{{TEAM_ID}}/1.40.0/macOS-Silent-macos-installer-x64-1.40.0.pkg

Replace {{TEAM_ID}} with your organization’s Swif team ID.


Step 3: Install Swif Silently

Once the installer is downloaded, use the following command to install Swif silently:

sudo installer -pkg macOS-Silent-macos-installer-x64-1.40.0.pkg -target /

The silent installer uses the configured identifier and removal key to attempt to remove the existing MDM profile before enrolling the Mac in Swif.

Note, profiles configured as non-removable through Automated Device Enrollment must first be removed through the previous MDM provider or migrated through Apple Business Manager.


Step 4: Verify Installation

  1. After the installation is complete, verify that the Swif agent has been successfully installed and the device is enrolled in Swif.

  2. Check for the removal of the previous MDM profile by running:

    sudo /usr/bin/profiles list

Additional Notes

  • After installation, the Swif Agent checks every 10 minutes for existing MDM profiles:

    • It will automatically attempt to remove any existing non-Swif MDM profiles using admin permissions, typically without requiring a removal password.

    • If an Identifier and Removal Key are provided (optional), the Agent will additionally attempt to use this combination to remove existing MDM profiles.

    • Swif does not detect or remove any existing agents, services, or apps related to other MDM providers.

  • Important: For devices enrolled via Apple’s Automated Device Enrollment (DEP), if the DEP profile is marked as non-removable, the Swif Agent cannot remove it. You must manually remove the device from your existing MDM provider in this case.

  • If you attempt installation by double-clicking the downloaded package and it does not open, enable it manually under System Settings > Privacy & Security. Using the command-line installation method (above) is strongly recommended instead.


Benefits of Silent Installation

  • Streamlined Setup: Automates the removal of existing MDM profiles and enrollment into Swif.

  • Scalable Deployments: Supports bulk deployment for enterprise environments.

  • User-Friendly Transition: Ensures minimal disruption during the device management transition.

For additional support, visit our help center or contact Swif support.

You can also use the silent installer on existing MDM-managed machines to silently migrate the existing MDM to Swif. Here are 2 examples:

Note, that the silent installer package can not be opened by double-clicking because of Apple policy or you might get this error "macOS silent installer can't be opened because Apple cannot check it for malicious software.

Did this answer your question?