Repository navigation
Add Capacitor live reload for Android and iPhone runs, and release 0.1.1 - #1
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.