DEV Community

Cover image for Test an Electron built snap package
Giacomo Lombardi
Giacomo Lombardi

Posted on

1

Test an Electron built snap package

Context

Electron is a very powerful tool to develop cross-platform apps. It also simplify the building process thanks to the electron-builder that targets Windows, MacOS and Linux.

Linux builds have many choices, rpm and deb are the most common ones as they target Debian and Red-Hat distros.

In 2014 Canonical started to develop a new package manager, snap that now is supported by all main distributions.

One release to rule them all
Enter fullscreen mode Exit fullscreen mode

The electron-builder creates a .snap file, but it is not executable.


Test the .snap file

A snap file is basically a single compressed filesystem using SquashFS. In order to test it we need to mount/uncompress the file.

1) unpack the snap file: unsquashfs -d /tmp/ <folder that will be created> <.snap file>
2) move to the newly created folder with unpacked data
3) the app should be in the root, just execute it

Note: i choose /tmp folder but anyone can choose where to unpack the snap file


Try a snap file is really really easy but nowhere I found how to do it, hope that this short post will help you.

Maybe more posts about snap will follow

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay