运行这条命令会显示以下输出:
Preparing Electron app...Converting icons...Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...Packaging app for platform linux x64 using electron v13.4.0 Finalizing build...App built to /home/tux/NativeApps/Mastodon-linux-x64, move to wherever it makes sense for you and run the contained executable file (prefixing with ./ if necessary)Menu/desktop shortcuts are up to you, because Nativefier cannot know where you're going to move the app. Search for "linux .desktop file" for help, or see https://wiki.archlinux.org/index.php/Desktop_entries
输出显示,文件被放置在 /home/tux/NativeApps/Mastodon-linux-x64。当你cd进入这个文件夹,你会看到一个名为Mastodon的文件。这是启动该应用的主要可执行文件。在你启动它之前,你必须给它适当的权限。
$ cd Mastodon-linux-x64chmod +x Mastodon
现在,执行 ./Mastodon就可以看到你的 Linux 应用启动了!
为我的博客创建一个应用
为了好玩,我也要为我的博客创建一个应用。如果没有 Linux 应用,拥有一个技术博客有什么用?
命令是:
$ nativefier -n ayushsharma \ -p linux -a x64 \ --width 1024 --height 768 \ --tray --disable-dev-tools \ --single-instance https://ayushsharma.in$ cd ayushsharma-linux-x64chmod +x ayushsharma
为 findmymastodon.com创建一个应用
最后,这是为我的宠物项目 findmymastodon.com制作的应用。
命令是:
$ nativefier -n findmymastodon \ -p linux -a x64 \ --width 1024 --height 768 \ --tray --disable-dev-tools \ --single-instance https://findmymastodon.com$ cd findmymastodon-linux-x64chmod +x findmymastodon