Creating “.dmg” file for Flutter Macos Apps💻

Prerequisite:

  1. OS: MacOS
  2. Node/NPM: You need to have Node/NPM installed on your machine.
Checking version of Node and npm

Creating the MacOS Release build of Flutter Application:

The first thing that we need to do is to create a release build for our Flutter MacOS Application with:

Release folder create by flutter build macos

Installing the Node Package for creating the .dmg:

Package Link: https://www.npmjs.com/package/appdmg

Creating config.json:

Now, Let’s create a new folder called “Installers” in our application root directory to keep our setup for creating installers organized. To separate the files from the ones we used for Windows .exe creation, let’s create another folder called “dmg_creator” in the “Installers” directory. In this directory, we will create a new file called config.json which will contain the configuration for the .dmg we wish to create, and along with this we also need to have a .icns icon file for the setup. Below is how this directory will look like:

Creating the .dmg file:

Once we have the config.json in place, we can use the appdmg executable to proceed further. for this you need to use the following command in the terminal:

appdmg <config-json-path> <output-dmg-path-with-file-name>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Paras Jain

Paras Jain

Mobile Application and Web Developer | @Youtube Content Creator | Worship #reactjs #flutter #java #dart | youtube.com/retroportalstudio