- Electron - Resources
- Electron - Packaging Apps
- Electron - Debugging
- Electron - Environment Variables
- Electron - Defining Shortcuts
- Electron - Audio & Video Capturing
- Electron - Webview
- Electron - Notifications
- Electron - System Tray
- Electron - Menus
- Electron - System Dialogs
- Inter Process Communication(IPC)
- Electron - Native Node Libraries
- Electron - File Handling
- Electron - Building UIs
- Electron - Hello World
- How Electron Works?
- Electron - Installation
- Electron - Overview
- Electron - Home
Electron Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Electron - Packaging Apps
Packaging and distributing apps is an integral part of the development process of a desktop apppcation. Since Electron is a cross-platform desktop apppcation development framework, packaging and distribution of apps for all the platforms should also be a seamless experience.
The electron community has created a project,
that takes care of the same for us. It allows us to package and distribute our Electron app with OS-specific bundles (.app, .exe etc) via JS or CLI.Supported Platforms
Electron Packager runs on the following host platforms −
Windows (32/64 bit)
OS X
Linux (x86/x86_64)
It generates executables/bundles for the following target platforms −
Windows (also known as win32, for both 32/64 bit)
OS X (also known as darwin) / Mac App Store (also known as mas)
Linux (for x86, x86_64, and armv7l architectures)
Installation
Install the electron packager using −
# for use in npm scripts $ npm install electron-packager --save-dev # for use from cp $ npm install electron-packager -g
Packaging Apps
In this section, we will see how to run the packager from the command pne. The basic form of the command is −
electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]
This will −
Find or download the correct release of Electron.
Use that version of Electron to create a app in <output-folder>/<appname>-<platform>-<arch>.
--platform and --arch can be omitted, in two cases. If you specify --all instead, bundles for all vapd combinations of target platforms/architectures will be created. Otherwise, a single bundle for the host platform/architecture will be created.
Advertisements