Skip to content

Add Capacitor live reload for Android and iPhone runs, and release 0.1.1 - #1

Merged
stackrats merged 2 commits into
mainfrom
release/0.1.1
Sep 17, 2026
Merged

stackrats merged 2 commits into
mainfrom
release/0.1.1

Conversation

@stackrats

Copy link
Copy Markdown
Owner

Android and iPhone Capacitor projects can opt into live reload beside Build and run. The user starts the project's development server and supplies its URL; buildbridge checks the server responds before building or installing, then builds and installs a debug shell whose WebView loads that server, so web edits use the server's own reload or HMR without another native build.

On Android the URL is applied through temporary debug Gradle inputs together with the HTTP debug allowance when the URL needs it. The overlay never writes into the host project or the synchronized source, release builds do not enable it, and each retained debug APK records the URL it was built with so a later install restores the ADB reverse route from the artifact rather than the current draft.

On iPhone the guest copies the compiled Debug .app and changes only that copy's Capacitor server.url and the Info.plist entries the URL needs, then the fixed signing helper signs the copy again with the same development identity and entitlements before the existing signature, profile, bundle and version checks run. The retained run records its live reload URL, and reconnecting to a detached session requires the same phone and settings.

Bump the workspace version to 0.1.1.

Android and iPhone Capacitor projects can opt into live reload beside
Build and run. The user starts the project's development server and
supplies its URL; buildbridge checks the server responds before building
or installing, then builds and installs a debug shell whose WebView loads
that server, so web edits use the server's own reload or HMR without
another native build.

On Android the URL is applied through temporary debug Gradle inputs
together with the HTTP debug allowance when the URL needs it. The overlay
never writes into the host project or the synchronized source, release
builds do not enable it, and each retained debug APK records the URL it
was built with so a later install restores the ADB reverse route from the
artifact rather than the current draft.

On iPhone the guest copies the compiled Debug .app and changes only that
copy's Capacitor server.url and the Info.plist entries the URL needs,
then the fixed signing helper signs the copy again with the same
development identity and entitlements before the existing signature,
profile, bundle and version checks run. The retained run records its
live reload URL, and reconnecting to a detached session requires the
same phone and settings.

Bump the workspace version to 0.1.1.
The guest job wrapper runs its body in a subshell under `set -eu` with an
EXIT trap that writes `$?` to the job's status file. bash 3.2, the /bin/sh
of every macOS guest, ends the shell on an assignment to a readonly
variable or an unbound-variable expansion as POSIX asks, but runs the trap
with a status of 0, so the job recorded a success and the wrapper exited 0.
bash 5 and dash hand the trap the real status, which is why only the macOS
half of CI caught it, in the debug job that must refuse an environment file
overwriting its development-server URL.

The wrapper now trusts a 0 only once the body ran to its end: the subshell
sets a flag as its last statement and the trap turns a 0 without that flag
into a 1. Every deliberate early exit in a job body is already nonzero.
Verified under bash 3.2 for a readonly assignment, an unbound variable, a
failing command, an explicit exit 3 and a clean body.
@stackrats
stackrats merged commit 90fdb8e into main Sep 17, 2026
5 checks passed
@stackrats
stackrats deleted the release/0.1.1 branch September 17, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant