Repository navigation
fix(stage2): launch the app under test in English whatever the device language - #161
Merged
Merged
Conversation
… language Stage 2's scripted scenario waits for English UI text, but the generated apps follow the device language, so a Japanese simulator failed the run on its first wait_for_text even though the app was fine. - iOS: Stage 1's `simctl launch` passes -AppleLanguages "(en)" -AppleLocale en_US. - Android: `cmd locale set-app-locales <pkg> --locales en-US` before the launch (API 33+); on older devices the launch goes ahead and a warning is traced. - Stage 2's foreground launch (and its springboard relaunch retry) asks mobile-mcp for locale en-US. - A failing text step on a screen with non-Latin text is reported as an `environment:` problem instead of a bare wait_for_text timeout. - installAndLaunch takes an injectable exec layer so the commands are unit-tested without simctl/adb. Closes #159 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr
…step Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr
Merged
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.
Closes #159
Stage 2 waits for English UI text ("Welcome to", button labels) but the generated apps follow the device language, so a simulator set to Japanese failed Stage 2 on its first step.
Changes
src/validation/launch.ts) now runsxcrun simctl launch booted <bundle> -AppleLanguages "(en)" -AppleLocale en_US.monkeylaunch:adb shell cmd locale set-app-locales <pkg> --locales en-US(Android 13 / API 33+). If it fails (older Android), the launch still goes ahead and a warning (LaunchResult.warnings) is traced: the app then follows the device language.MobileClient.launchApp(pkg, locale)passeslocale: "en-US"to mobile-mcp'smobile_launch_app(0.0.54 supports it:-AppleLanguages/-AppleLocaleon iOS simulators through mobilecli,set-app-localeson Android), so the retry path is English too.wait_for_text/tap_textstep fails and the screen shows non-Latin text, the Stage 2 error readsenvironment: the app's UI is not in English (the screen shows "Orange Baton へようこそ") although the agent launched it in English (...); ... Set the simulator's language to English and re-run. (<original step error>). Deliberately simple: Latin-script languages (French, German) still surface as a plain step failure.installAndLaunch/selectAdbTargettake an injectable exec layer (LaunchExec) so the commands are unit-tested without simctl/adb.NATIVEAPPTEMPLATE_VISUAL=2.Tests
set-app-localesordering (after install, before monkey; emulator picked over a phone), Android < 13 fallback warning — via a recording exec.en-US.Orange Baton へようこそ→environment:error; an English screen keeps the plain error.npm run ci: 192 pass.Real-device check (no paid run)
Using the already-built Orange Baton app:
AppleLanguages (ja-JP, en-US)/ja_JP: plainsimctl launch→ Japanese UI;installAndLaunchfrom this branch → "Welcome to Orange Baton" / "Start" / "Support Website".mobile_launch_appon the same Japanese simulator: withoutlocale→Orange Batonへようこそ | はじめる; withlocale: "en-US"→Welcome to Orange Baton | Start(both attempts).ja-JP: plain launch →Orange Batonへようこそ / はじめる;installAndLaunchfrom this branch → English,get-app-locales=[en-US].en-US, ja-JP/en_USand left booted; emulator restored toen-US.🤖 Generated with Claude Code
https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr