我已经完成了这里的教程:https ://appimage-builder.readthedocs.io/en/latest/intro/tutorial.html#
这导致了一个可运行的 Qt AppImage Template-latest-x86_64.AppImage 文件(没有运行 docker 测试)。
最初,AppImage 按预期工作。从 GUI 中双击 AppImage 或通过控制台运行它会导致教程应用程序运行。
但是,有两种情况会导致 AppImage 文件不再工作:
如果重新启动构建 AppImage 的机器,相同的 AppImage 将不再运行。
如果 AppImage 转移到另一台机器上,它将不再运行。该机器与构建 AppImage 的操作系统版本相同。
两种情况具有相同的行为。应用程序看起来好像不包含可执行代码并立即退出。通常,应用程序有一个 GUI 界面。不显示错误消息。
从控制台运行:
tb@dt:~/appimage_tutorial/qt-appimage-template$ ll
total 176860
drwxr-xr-x 8 tb tb 4096 Nov 23 14:25 ./
drwxr-xr-x 3 tb tb 4096 Nov 23 14:18 ../
drwxr-xr-x 6 tb tb 4096 Nov 23 14:25 AppDir/
drwxr-xr-x 4 tb tb 4096 Nov 23 14:25 appimage-builder-cache/
-rw-r--r-- 1 tb tb 3430 Nov 22 22:35 AppImageBuilder.yml
-rw-r--r-- 1 tb tb 13981 Nov 23 14:18 CMakeCache.txt
drwxr-xr-x 4 tb tb 4096 Nov 23 14:18 CMakeFiles/
-rw-r--r-- 1 tb tb 1808 Nov 23 14:18 cmake_install.cmake
-rw-r--r-- 1 tb tb 439 Nov 23 14:18 CMakeLists.txt
-rw-r--r-- 1 tb tb 498 Nov 23 14:18 conanfile.txt
drwxr-xr-x 8 tb tb 4096 Nov 23 14:18 .git/
-rw-r--r-- 1 tb tb 19 Nov 23 14:18 .gitignore
-rw-r--r-- 1 tb tb 450 Nov 23 14:18 .gitlab-ci.yml
-rw-r--r-- 1 tb tb 159 Nov 23 14:18 install_manifest.txt
-rw-r--r-- 1 tb tb 6948 Nov 23 14:18 Makefile
-rwxr-xr-x 1 tb tb 181010472 Nov 23 14:25 'Qt AppImage Template-latest-x86_64.AppImage'*
-rw-r--r-- 1 tb tb 67 Nov 23 14:18 README.md
drwxr-xr-x 3 tb tb 4096 Nov 23 14:18 res/
drwxr-xr-x 4 tb tb 4096 Nov 23 14:18 src/
tb@dt:~/appimage_tutorial/qt-appimage-template$ ./'Qt AppImage Template-latest-x86_64.AppImage'
tb@dt:~/appimage_tutorial/qt-appimage-template$
(什么都没发生)
数据库:
(gdb) run
Starting program: /home/tb/appimage_tutorial/qt-appimage-template/Qt AppImage Template-latest-x86_64.AppImage
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 2651 is executing new program: /tmp/.mount_Qt AppVj8Ud9/AppRun
[Inferior 1 (process 2651) exited with code 01]
(gdb)
AppImage 是从 ~/appimage_tutorial/qt-appimage-template 目录构建的,使用:appimage-builder --skip-test
这是构建 AppImage 时输出的最后一部分:
INFO:root:Writing bundle info to: .bundle.yml
INFO:root:Downloading runtime: https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64
INFO:root:Generating AppImage from ./AppDir
INFO:appimagetool:appimagetool --runtime-file appimage-builder-cache/runtime-x86_64 ./AppDir /home/tb/appimage_tutorial/qt-appimage-template/Qt AppImage Template-latest-x86_64.AppImage
INFO:appimagetool:Parallel mksquashfs: Using 4 processors
INFO:appimagetool:Creating 4.0 filesystem on /home/tb/appimage_tutorial/qt-appimage-template/Qt AppImage Template-latest-x86_64.AppImage, block size 131072.
INFO:appimagetool:[============- ][===========================================================\] 11826/11826 100%
INFO:appimagetool:
INFO:appimagetool:Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
INFO:appimagetool:compressed data, compressed metadata, compressed fragments,
INFO:appimagetool:compressed xattrs, compressed ids
INFO:appimagetool:duplicates are removed
INFO:appimagetool:Filesystem size 176580.52 Kbytes (172.44 Mbytes)
INFO:appimagetool:35.82% of uncompressed filesystem size (492966.84 Kbytes)
INFO:appimagetool:Inode table size 142021 bytes (138.69 Kbytes)
INFO:appimagetool:23.51% of uncompressed inode table size (604061 bytes)
INFO:appimagetool:Directory table size 152721 bytes (149.14 Kbytes)
INFO:appimagetool:33.80% of uncompressed directory table size (451834 bytes)
INFO:appimagetool:Number of duplicate files found 1031
INFO:appimagetool:Number of inodes 15794
INFO:appimagetool:Number of files 8380
INFO:appimagetool:Number of fragments 355
INFO:appimagetool:Number of symbolic links 6432
INFO:appimagetool:Number of device nodes 0
INFO:appimagetool:Number of fifo nodes 0
INFO:appimagetool:Number of socket nodes 0
INFO:appimagetool:Number of directories 982
INFO:appimagetool:Number of ids (unique uids + gids) 1
INFO:appimagetool:Number of uids 1
INFO:appimagetool:root (0)
INFO:appimagetool:Number of gids 1
INFO:appimagetool:root (0)
INFO:appimagetool:/home/tb/appimage_tutorial/qt-appimage-template/AppDir should be packaged as /home/tb/appimage_tutorial/qt-appimage-template/Qt AppImage Template-latest-x86_64.AppImage
WARNING:appimagetool:appimagetool, continuous build (commit aaef827), build 2143 built on 2020-11-22 12:53:26 UTC
WARNING:appimagetool:Using architecture x86_64
WARNING:appimagetool:Deleting pre-existing .DirIcon
WARNING:appimagetool:Creating .DirIcon symlink based on information from desktop file
WARNING:appimagetool:WARNING: AppStream upstream metadata is missing, please consider creating it
WARNING:appimagetool:in usr/share/metainfo/QtQuickControls2Application.appdata.xml
WARNING:appimagetool:Please see https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps
WARNING:appimagetool:for more information or use the generator at http://output.jsbin.com/qoqukof.
WARNING:appimagetool:Generating squashfs...
WARNING:appimagetool:Embedding ELF...
WARNING:appimagetool:Marking the AppImage as executable...
WARNING:appimagetool:Embedding MD5 digest
WARNING:appimagetool:Success
WARNING:appimagetool:
WARNING:appimagetool:Please consider submitting your AppImage to AppImageHub, the crowd-sourced
WARNING:appimagetool:central directory of available AppImages, by opening a pull request
WARNING:appimagetool:at https://github.com/AppImage/appimage.github.io
INFO:root:AppImage created successfully