appimagetool Documentation

repository·main·Indexed 18 days ago

https://github.com/appimage/appimagetool

A utility used to generate AppImage files from existing AppDir structures. It provides a command-line interface for customizing generation via signing, compression, and metadata handling, and supports configuration through environment variables. The tool can be built for various architectures using provided Docker scripts and integrates with the AppImage runtime.

Tokens
1.5K
Snippets
4
Records
5
Agent score
14%

What's inside appimagetool

  1. How appimagetool handles the AppImage runtime

    main
    By default, appimagetool downloads the latest AppImage runtime from the type2-runtime GitHub releases. If your build system lacks internet access or you prefer a specific version, you can provide a local runtime using the --runtime-file CLI flag.
  2. Generate an AppImage from an AppDir

    main

    Use appimagetool to convert an existing AppDir into a single AppImage file. You can specify a source directory and an optional destination path. It is recommended to set the ARCH environment variable if the tool cannot automatically determine the architecture of the binaries inside the AppDir.

    ARCH=x86_64 ./appimagetool-x86_64.AppImage some.AppDir
  3. Build appimagetool using Docker

    main

    You can build appimagetool for different architectures using the provided Docker build scripts. For cross-compiling to ARM on an Intel machine, you must first prepare the Docker system with qemu-user-static.

    # For 64 bit Intel
    ARCH=x86_64 bash ./ci/build-in-docker.sh
    
    # For 32 bit Intel
    ARCH=i686 bash ./ci/build-in-docker.sh
    
    # Prepare for ARM cross-compilation
    docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    
    # For 64 bit ARM
    ARCH=aarch64 bash ./ci/build-in-docker.sh
    
    # For 32 bit ARM
    ARCH=armhf bash ./ci/build-in-docker.sh
  4. Configure appimagetool via environment variables

    main

    Several configuration parameters can be passed via environment variables, which is particularly useful for CI/CD environments.

    - ARCH: Needs to be set whenever appimagetool cannot automatically determine the architecture of the binaries inside the AppDir to choose a suitable runtime (e.g., when binaries for multiple architectures or just shell scripts are contained in there).
    - APPIMAGETOOL_APP_NAME: If no destination is set by the user, appimagetool automatically generates a suitable output filename, using the root desktop entry's `Name` field. With this environment variable, this value can be set explicitly by the user.
    - APPIMAGETOOL_SIGN_PASSPHRASE: If the `--sign-key` is encrypted and requires a passphrase to be used for signing (and, for some reason, GnuPG cannot be used interactively, e.g., in a CI environment), this environment variable can be used to safely pass the key.
    - VERSION: This value will be inserted by appimagetool into the root desktop file and (if the destination parameter is not provided by the user) in the output filename.
  5. Reference the appimagetool CLI options

    main

    The appimagetool command-line interface provides several options for customizing the AppImage generation process, including signing, compression, and metadata handling.

    Usage:
      appimagetool [OPTION...] SOURCE [DESTINATION] - Generate AppImages from existing AppDirs
    
    Help Options:
      -h, --help                  Show help options
    
    Application Options:
      -l, --list                  List files in SOURCE AppImage
      -u, --updateinformation     Embed update information STRING; if zsyncmake is installed, generate zsync file
      -g, --guess                 Guess update information based on environment variables set by common CI systems (GitHub actions, GitLab CI)
      --version                   Show version number
      -v, --verbose               Produce verbose output
      -s, --sign                  Sign with gpg[2]
      --comp                      Squashfs compression
      -n, --no-appstream          Do not check AppStream metadata
      --exclude-file              Uses given file as exclude file for mksquashfs, in addition to .appimageignore.
      --runtime-file              Runtime file to use
      --sign-key                  Key ID to use for gpg[2] signatures
      --sign-args                 Extra arguments to use when signing with gpg[2]