Repository navigation
Troubleshooting
Check:
-
apmdis running - Android uses abstract socket
@apmd, so there is no filesystem socket to inspect - emulator mode uses
$HOME/APMEmulator/data/apm/apmd.socket -
/data/apm/logs/apmd.logfor bind/listen/auth errors
Check:
- session lifetime is only
180seconds -
/data/apm/.security/session.binexists and is readable -
/data/apm/.security/still exists after resets or manual cleanup
If setup was never completed, the first privileged command will ask you to create a password/PIN and exactly 3 security questions.
Wrong security answers trigger a 5 minute cooldown.
State file:
/data/apm/.security/reset-lockout.txt
Check:
-
.reposource files under/data/apm/sources/ - trusted keys under
/data/apm/keys -
Trusted=andDeb-Signatures=options in the source definition -
/data/apm/logs/apmd.logfor Release, InRelease, checksum, or Packages download errors - HTTPS certificate availability; the downloader uses
APM_CAINFOfirst, then common system CA bundle files and CA directories
Remember:
-
Packages.gzand plainPackagesare supported -
Packages.xzis not used in the current Android path
If HTTPS downloads fail with certificate errors, point APM_CAINFO at a PEM bundle readable by the daemon environment.
Release verification:
- import the correct public key with
apm key-add - inspect
Trusted=for the affected source
Detached .deb verification:
- inspect
Deb-Signatures=for the source - inspect
/data/apm/pkgs/sig-cache.json - clear stale cache entries if needed:
apm sig-cache clearAPM reads the .deb ar container internally and decodes gzip, XZ, bzip2,
legacy LZMA, and Zstandard members before invoking tar. Installing an external
ar or xz command is unnecessary with current builds. Both apm and apmd
must be rebuilt and deployed to use this extraction path; restart apmd after
replacing it.
If extraction still fails, the error includes tar's diagnostic output. Check
that tar is available in the daemon's PATH, the download is complete, and
/data/apm/cache has enough space for the decompressed member. Temporary tar
files are removed on success and failure. Compressed members have an 8 GiB
output limit and decoders have a 256 MiB memory/window limit. Unsafe archive
paths, links, and device nodes are rejected before payload extraction.
For local .deb installs:
- confirm the file exists
- confirm the archive is actually a readable Debian package
For tar-style manual installs (.tar, .tar.gz, .tgz, .tar.xz, .txz, .gz, .xz):
- confirm the archive contains exactly one intended package root
- confirm
package-info.jsonexists - confirm
package-info.jsonincludespackageandprefix
Manual package metadata is stored under:
/data/local/tmp/apm/runtime/manual-packages
Check the current runtime paths, not the older /data/apm/bin layout:
- generated shims:
/data/local/tmp/apm/bin/<name>
- generated PATH files:
/data/local/tmp/apm/path/sh-path.sh/data/local/tmp/apm/path/bash-path.sh
- boot fallback hooks:
/system/bin/apm-sh-path/system/bin/apm-bash-path
Also check:
-
/data/apm/logs/apmd.logforexport_pathwarnings - managed shell startup files for the APM hook block
- a fresh shell session after install/remove operations
Command collision behavior:
- shims that collide with Android system commands are skipped
- collisions between managed packages can produce namespaced shims such as
<package>-<command> - install/remove output and
apmd.logreport collision warnings when hotload is rebuilt
Check:
- the ZIP contains
module-info.json - the ZIP contains
overlay/ - module name uses only
[A-Za-z0-9._-] - if
install-sh: true,install.shexists -
install.shexits with status0 -
unzipis available on the device
Logs:
/data/ams/logs/<module>.log/data/ams/logs/amsd.log
Remember:
- if
install.shfails, AMS rolls the install back automatically
Check:
/data/ams/.amsd_boot_counter/data/ams/.amsd_safe_mode_threshold/data/ams/.amsd_safe_mode- the module
state.jsonfile /data/ams/.runtime/bind-mounts-system.txt/data/ams/.runtime/bind-mounts-vendor.txt/data/ams/.runtime/bind-mounts-product.txt/data/ams/logs/amsd.log
If a target partition was not mounted when amsd started, the partition monitor may retry later in the same boot. If safe mode is active, overlays are intentionally skipped.
The current backend uses read-only bind mounts plus small read-only overlay mounts. Make sure top-level entries under overlay/system, overlay/vendor, and overlay/product match existing files or directories on the target partition.
Check:
-
apmdis running as root - the AMS module skeleton
apm-system-appscan be created under/data/ams/modules/ -
/data/ams/modules/apm-system-apps/overlay/system/app/is writable /data/ams/modules/apm-system-apps/module-info.json/data/ams/modules/apm-system-apps/state.json/data/ams/modules/apm-system-apps/workdir/system/
Also remember:
- successful staging still requires a reboot before Android recognizes the APK as a system app
The uninstall flow:
- tries
pm uninstall <package> - falls back to
pm uninstall --user 0 <package> - then does best-effort overlay cleanup
Check:
/data/ams/modules/apm-system-apps/overlay/system/app/<package>/data/apm/logs/apmd.log
apmd refuses to continue if legacy modules still exist under:
/data/apm/modules
Current AMS uses:
/data/ams/modules
The supported cleanup path is a factory reset.
Current factory reset targets:
- installed runtime content
- generated shim binaries
- manual package metadata
- security data
- package status DB
- AMS modules
- repository lists
- system apps staged through
--install-as-system
It may leave behind:
- source definitions
- trusted keys
- package download cache
- general cache directories
Check the resulting daemon message and /data/apm/logs/apmd.log for partial-failure details.
For cache-only cleanup after a reset, run:
apm wipe-cache all