1. Home
  2. Mac App Management
  3. How to convert APP to PKG for Enterprise app distribution

How to convert APP to PKG for Enterprise app distribution

Hexnode MDM provides an easy method for the distribution of enterprise applications on Mac devices. The apps pushed through Hexnode get silently installed in the device without any user intervention. Applications that run on macOS come in various formats like ‘.app’, ‘.dmg’ and ‘.pkg’. It is recommended to convert APP to PKG format.

One way to distribute apps in ‘.app’ format is by publishing them to the App Store and manually downloading them in all user devices. This process can be made easier by converting it to .pkg format and deploying it over the network or by placing it in a shared folder. For the same reason, Hexnode MDM only supports the distribution of applications that are in the PKG format. Distribution of application in the PKG format helps to reduce steps and save the time taken for installation.

Packages are folders which contain numerous files within. However, they appear as a single file to the user. They come as files with a ‘.pkg’ extension. A double click on the PKG file launches the installer GUI. These installers can do things that the drag and drop installers (for dmg files) cannot, like installing system services and specifying the install location. The PKG file can be deleted once the installation is complete.

Steps to convert ‘.app’ file to ‘.pkg’ file using Terminal

  1. Open Terminal.
  2. Use the command given below to build package.
    productbuild {--component component-path /filename.app install-path} product-output-path/packagename.pkg

    The productbuild command is used to build product archive for the OS X Installer or the Mac App Store. The three arguments specify the location of the already installed .app file (/component-path/filename.app),the path to the location where the app should be installed(install-path) and the desired location of the newly generated .pkg file (/product-output-path/packagename.pkg), respectively.

  3. Enter your device login password and wait for the build to complete.
    productbuild: Adding component at 'componentpath'/SampleApplication.app 
    productbuild: Wrote product to 'product-output-path'/SamplePackage.pkg 
    productbuild: Supported OS versions: [10.14, )

    A similar message is displayed on the Terminal indicating the successful creation of package file.

  4. Proceed to the destination path to find the package file.
  5. SampleApplication.app converted to SamplePackage.pkg

Signing a PKG file is essential for security purposes, to ensure that the app is safe and trustable for use and is free from malware. Check out how to sign macOS pkg files for deployment.

And we are done! A package can be distributed via email, FTP, the cloud, thumb drives, and so on. Now you can go ahead and start distributing the packages.

Note

This is only one of the methods that can be used for converting .app to .pkg. Other methods include using tools like Packages, AutoPkg, munkipkg etc.

  •  
  •  
  •  
  •  
  •  

Was this article helpful?

Related Articles

Leave a Comment