FAQ: Product Provisioning for OS X

Do I need the AirWatch Agent for OSX to use Product Provisioning?

Yes.  The AirWatch Agent must be installed and enrolled in order to push scripts and apps through Products, as well as to capture Custom Attributes.


What folder should I use for the download location in Files/Actions?

  • Install Files:  We recommend placing files related to install actions (and the install manifest) in the /tmp folder (e.g. /tmp/script.sh).  By default, OS X will remove files/folders older than 3 days from this folder.  
  • Uninstall Files:  We recommend placing files related to uninstall actions (and the uninstall manifest) in a location which is not automatically cleared of older files, such as /Library/Scripts (e.g. /Library/Scripts/script.sh).  


When creating a Product, should I use the Install or Uninstall manifest?

When creating a product where you intend to install a product, use the Install manifest. To have an Uninstall Manifest of a Files/Actions automatically run upon removal of the Files/Actions, only push a product with an "Install Files/Actions" manifest item for the Files/Actions. A product does not need to be configured to push an "Uninstall Files/Actions" manifest item for this Files/Actions to run automatically upon removal. Pushing an "Uninstall Files/Actions" manifest item will immediately run the Uninstall Manifest and remove the Files/Actions. 



My script isn't working as expected when I push it via Products?

Scripts (AppleScript and Bash scripts) execute in the root context in OS X.  As such, there are few tips you'll want to follow to achieve scripting success:

  • Ensure your script works when you manually execute it outside of AirWatch (such as within the Terminal app).
    • You can determine which line is causing issues in your script by using the following command:  PS4='Line ${LINENO}: ' bash -x scriptfile.sh where scriptfile.sh is the name of the script you're troubleshooting.
  • Include the full path to commands (such as /usr/bin/scutil rather than scutil)
    • Most commands are found in /usr/bin and /usr/sbin/
  • Ensure the script does not require a combination of root and user run scopes.
    • Scripts running in the root scope do not have access to the Aqua/GUI interface and cannot prompt the user for information.


How do I troubleshoot scripts pushed via Products

When scripting with shell/bash, be sure to code for error handling:

  • Optionally, you can use the set -e command to force termination of a shell script upon error.  By default, shell scripts continue on error.
  • AirWatch Products only report on script start/stop and a returned error code.  For further detail and information, we recommend logging to a file or the system log within your script.  You can log direclty to the system log via the following command:  syslog -s -l error "[ScriptName] Error or Warning Message to Log"
  • Even if you attempt to exit successfully, any output to stderr will be captured by the agent and cause the job to fail.  You can intercept output to stderr as part of your error handling as follows:   [command] > /dev/null 2>&1
  • Starting with macOS Agent 2.4.1, you can determine if you are having a script execution problem by running the following in the terminal on a macOS device: 

    cat /Library/Application\ Support/AirWatch/Data/Logs/AirWatchDaemon.log | grep "Script Execution"

    • The command should return something similar to this:   Nov 3 13:19:34  airwatchd[930] <Info>: -[AWExecuteScriptHandler executeScriptAtPath:error:] [Line 107] Script Execution Failed: LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Install Adobe Acrobat Reader DC.app.
    • Note: sometimes error messages can be multi-line.  For more information, open the AirWatchDaemon.log file and locate the date/time stamp(s) returned by the previous cat command to see any additional logging.



Does AirWatch support DMG, MPKG, or PKG files in Products?

Yes.  Here are the best practices for deploying these files: 

  • For DMG files that contain a PKG (or MPKG) file, extract the MPKG or PKG file for distribution with a Product.  Use the “Install” manifest item in order to have AirWatch automatically run the installer.
    • MPKG or PKG files that require user input (such as license keys) are not supported for installation via Products.   Work with your software vendor to repackage the DMG/PKG in a way that doesn't require user intervention.  Typically, vendors work-around this by using a plist file to specify the values which would normally be prompted during install.  This plist file can then be distributed as part of your files/actions for the product.
  • DMG files that contain only an app folder (*.app) can be distributed using Internal Applications rather than Products.   The *.app folder on the DMG can be zipped and distributed as an Internal Application.
Have more questions? Submit a request


Article is closed for comments.