What is devmode for snaps?
Developer mode, or devmode
in short, enables developers and users to install snaps without enforcing security policies. E.g.
sudo snap install notes --devmode
When installed this way, snaps behave in a similar way to traditional .deb packages in terms of accessing system resources. That is, snaps have access to the system without being restricted by app isolation and interfaces.
Developer mode is useful when:
- Testing a snap in the first stages of development to ensure it runs as expected
- Temporarily bypassing security enforcement if there is not yet an interface available that controls a particular system access required by the snap
As a developer, you can also relax security requirements at the snapcraft.yaml level by declaring devmode
confinement instead of strict
confinement: devmode
You'll be then flagging users that this app specifically needs to be installed with --devmode
to work. Not specifying the switch will result in failure to install.
That is, users will have to specifically acknowledge that they will install your snap in developer mode.
Related videos on Youtube
David Planella
I work at GitLab as Director of Community Relations. Before, I worked for Canonical as the former Ubuntu Community Team Manager. As an Open Source contributor, I am mostly involved in app development and localization: I'm the developer of Qreator, former lead the Ubuntu Catalan Translators team and also a GNOME translator. In the past I've contributed to other projects, such as Debian or Mozilla. Blog Google+ Twitter
Updated on September 18, 2022Comments
-
David Planella over 1 year
I have heard about the ability to use snaps in developer mode.
What is this mode and what can I use it for?
-
kyrofa almost 8 yearsMight be worth mentioning the new
confinement
property supported within the YAML (more info here). -
dholbach almost 8 yearsMaybe also mention that apps with
confinement: devmode
can only be uploaded to the alpha/beta channels. -
David Planella almost 8 years@dholbach thanks! Which channels are they exactly? I can see
beta
, but there doesn't seem to be analpha
channel in the channels documentation page - other than a mention in the picture -
David Planella almost 8 yearsDavid Callé tells me: «Alpha does not exist in the store (hence, it has been dropped from the channels doc that previously mentioned it), it's "edge" and "beta". The store UI also warns you during the upload step: "If confinement is set to devmode, upload must target devel channels (beta, edge). Other channels will be excluded."»