gcloud app browse: Get the App Engine URL
gcloud app browse opens or, with --no-launch-browser, just prints the URL of an App Engine service.
After an App Engine deploy, capturing the served URL for a smoke test is exactly what browse does. In CI you want the print-only form.
What it does
gcloud app browse resolves the URL of a deployed App Engine service (and optionally a specific version) and opens it in a browser. With --no-launch-browser it prints the URL to stdout instead, which is what automation needs.
Common usage
# print the default service URL, do not open a browser
URL=$(gcloud app browse --no-launch-browser)
curl -fsS "$URL/healthz"
# a specific service and version
gcloud app browse --service=api --version=v2 \
--no-launch-browserFlags
| Flag | What it does |
|---|---|
| --no-launch-browser | Print the URL instead of opening a browser |
| --service <name> | Browse a specific service (default: default) |
| --version <id> | Browse a specific version |
| --project <id> | Project the app is deployed in |
In CI
Always use --no-launch-browser on a runner; there is no browser, and without the flag the command tries to launch one and may error or stall. Capture the printed URL into a variable for a post-deploy smoke test.
Common errors in CI
"The current Google Cloud project [..] does not contain an App Engine application" means App Engine was never initialized; run gcloud app create first. Attempting to open a browser on a headless runner can print a "could not open" warning; --no-launch-browser avoids it. A wrong --service or --version yields an unresolved URL.