How to know if a desktop app uses Electron

Here's a way to check in macOS using Finder or bash

· 2 min read
A monkey in a thoughtful pose with a thought bubble above it that contains the Electron.js logo and a question mark

Electron is a popular platform to publish desktop apps these days. Many people are familiar with popular applications like VSCode or Slack that are written in Electron, but is there a way I can check on my own to know if an app was built using Electron?

Yes. In fact, I created a quick video of the process (macOS only):

I was surprised at how many views it got (I know, it's not that many in the grand scheme of things but I'm small-time so it was a lot for me).

Written out, the above process is this:

  1. Right click .app file
  2. Click "Show Package Contents"
  3. Navigate into Contents
  4. Navigate into Frameworks
  5. Check if there's a Electron Framework.framework file

Why does this work?

macOS apps are actually a directory that simply looks like a file. Application bundles follow a specific format. A "framework", which is a dynamic shared library, will always reside in Contents/Frameworks. You can read more about macOS app bundles on Wikipedia or Apple's developer docs.

That process might sound tedious if you want to check all of your applications at once. So, that's why I created a bash script that checks for you 😎:

The overall process of the script is that it runs a find for every .app directory. For each match, it checks if a Electron Framework.framework file exists. If it does, we found an app that uses Electron. Interestingly I found that the find runs really slow without the -maxdepth option (using -depth didn't help, had to be maxdepth). I'm not exactly sure why, I'll have to dig into that later. My best guess is that some of the .app folders go really deep and -maxdepth limited the recursion in a way that -depth doesn't.

Related posts