在 Ubuntu 上调试 AppImage 可以从运行方式、日志获取、环境隔离、内部排查几个层面入手。下面按实用顺序说明。
chmod +x xxx.AppImage
./xxx.AppImage
如果没反应或报错,继续看下面。
./xxx.AppImage
很多 AppImage 错误只在终端显示。
./xxx.AppImage --verbose
./xxx.AppImage --debug
(是否支持取决于程序本身)
AppImage 本质是一个压缩文件系统。
./xxx.AppImage --appimage-extract
会生成 squashfs-root/ 目录。
cd squashfs-root
ls -la
常见内容:
AppRun*.desktopusr/bin/usr/lib/cd squashfs-root
./AppRun
或:
./usr/bin/程序名
这样可以:
gdb 调试LD_DEBUG=libs ./xxx.AppImage
QT_DEBUG_PLUGINS=1 ./xxx.AppImage
GTK_DEBUG=interactive ./xxx.AppImage
报错类似:
fusermount not found
解决:
sudo apt install fuse libfuse2
Ubuntu 22.04+ 默认可能没有
libfuse2
用 ldd 检查:
ldd squashfs-root/usr/bin/程序名
缺哪个装哪个,例如:
sudo apt install libssl3 libgl1
./xxx.AppImage --appimage-extract
cd squashfs-root
gdb ./usr/bin/程序名
或:
gdb --args ./xxx.AppImage
journalctl -xe
ulimit -c unlimited
./xxx.AppImage
提供:
ldd 输出如果你愿意,可以告诉我:
我可以帮你精确定位问题。