Hot reload
PAM Native development reload sends a bounded application bundle to the running Android host and remounts the PHP component tree. Local user state may reset, similar to a full component refresh. The Android process must remain alive and interactive.
Start one development session
Section titled “Start one development session”pam mobile dev .The command builds and installs the debug APK, starts the application, forwards the device connection, and listens for source changes.
Only one process may own the default hot reload port:
127.0.0.1:39100Fix “Address already in use”
Section titled “Fix “Address already in use””Find the process that owns the port:
ss -ltnp 'sport = :39100'Stop the stale pam mobile dev process gracefully, then start one fresh
session. Do not keep two watchers for the same application and port.
If you intentionally run several applications, assign distinct development ports according to each project’s mobile configuration.
Reload contract
Section titled “Reload contract”On a valid change PAM:
- waits for the current render operation to reach a safe boundary;
- transfers a size-bounded bundle with safe relative paths;
- activates files atomically;
- reloads the PHP entrypoint;
- remounts the component and event tree; and
- commits the next native render.
The reload does not promise to preserve form values, navigation history, or arbitrary PHP objects. It does promise not to leave buttons and other semantic events connected to a disposed runtime.
When a reload fails
Section titled “When a reload fails”Keep the last valid UI visible and inspect:
adb logcat -s PamNative PamRuntime AndroidRuntimepam doctor .Typical causes are:
- a PHP parse or type error;
- a missing Composer class after changing dependencies;
- a bundle larger than the development limit;
- an unsafe or invalid source path;
- an ADB forward that belongs to a stale session; or
- an Android process crash in a native view or plugin.
Dependency changes may require rebuilding the APK or application bundle. A PHP source edit should not.
Verify interactions after reload
Section titled “Verify interactions after reload”After every fix to the development pipeline, test at least:
- increment a counter;
- edit the component source;
- wait for the remount;
- press the same button again;
- navigate forward and use Android back; and
- open and dismiss one overlay.
This catches the failure mode where the screen redraws but events still point to the old PHP runtime.