chore(mobile): drive dev-menu suppression from the dev-client launch URL (#12049)
Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
438af295fe
commit
ce920f2ac8
2 files changed
+13
-23
No files matched your search
@@ -41,6 +41,9 @@ Start `vp run dev:client` from `apps/mobile`, or reuse a healthy Metro belonging
|
||||
to this checkout. Open its printed development-client URL with AgentDevice
|
||||
`open com.t3tools.t3code.dev <url>` and all returned target arguments.
|
||||
The device must be able to reach both Metro and the isolated backend.
|
||||
Append `&disableAutoLaunch=1&disableFab=1` to the development-client URL query
|
||||
when developer chrome would obscure screenshots or taps; the SDK 58 dev client
|
||||
applies these preferences before the app loads.
|
||||
|
||||
## Pair and verify
|
||||
|
||||
|
||||
+10
-23
@@ -34,6 +34,9 @@ const REPO_ROOT = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import
|
||||
const MOBILE_ROOT = NodePath.join(REPO_ROOT, "apps/mobile");
|
||||
const ANDROID_PACKAGE = "com.t3tools.t3code";
|
||||
const APP_SCHEME = "t3code";
|
||||
// expo-dev-launcher reads these off the manifest URL and updates the dev menu
|
||||
// preferences before the app loads, keeping captures free of dev chrome.
|
||||
const DEV_CLIENT_LAUNCH_FLAGS = "disableOnboarding=1&disableFab=1&disableAutoLaunch=1";
|
||||
const IOS_READY_FILENAME = "T3ShowcaseReadyScene";
|
||||
const SERVER_HOST = "0.0.0.0";
|
||||
const IOS_SIMULATOR_ARCH = NodeProcess.arch === "arm64" ? "arm64" : "x86_64";
|
||||
@@ -1107,25 +1110,9 @@ async function captureIos(
|
||||
await runCommand("xcrun", ["simctl", "install", simulator.udid, appPath]);
|
||||
}
|
||||
|
||||
for (const [key, value] of [
|
||||
["EXDevMenuIsOnboardingFinished", "true"],
|
||||
["EXDevMenuShowFloatingActionButton", "false"],
|
||||
["EXDevMenuShowsAtLaunch", "false"],
|
||||
] as const) {
|
||||
await runCommand("xcrun", [
|
||||
"simctl",
|
||||
"spawn",
|
||||
simulator.udid,
|
||||
"defaults",
|
||||
"write",
|
||||
ANDROID_PACKAGE,
|
||||
key,
|
||||
"-bool",
|
||||
value,
|
||||
]);
|
||||
}
|
||||
|
||||
const metroUrl = `http://${metroHost}:${config.metroPort}?disableOnboarding=1`;
|
||||
// The dev-client launch URL carries the dev menu preferences (SDK 58), so
|
||||
// nothing is written into the app container ahead of launch.
|
||||
const metroUrl = `http://${metroHost}:${config.metroPort}?${DEV_CLIENT_LAUNCH_FLAGS}`;
|
||||
const scenePath = NodePath.join(
|
||||
await iosAppContainer(simulator.udid),
|
||||
"Library/Caches/T3ShowcaseScene",
|
||||
@@ -1357,12 +1344,12 @@ async function writeAndroidShowcaseScene(serial: string, scene: ShowcaseScene):
|
||||
]);
|
||||
}
|
||||
|
||||
// Gesture and key-command toggles have no launch-URL flag, so they still go
|
||||
// through the preferences file; onboarding, auto-launch and the floating button
|
||||
// come from DEV_CLIENT_LAUNCH_FLAGS on the launch URL.
|
||||
async function prepareAndroidShowcaseApp(serial: string): Promise<void> {
|
||||
const preferences = `<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<map>
|
||||
<boolean name="isOnboardingFinished" value="true" />
|
||||
<boolean name="showsAtLaunch" value="false" />
|
||||
<boolean name="showFab" value="false" />
|
||||
<boolean name="motionGestureEnabled" value="false" />
|
||||
<boolean name="touchGestureEnabled" value="false" />
|
||||
<boolean name="keyCommandsEnabled" value="false" />
|
||||
@@ -1435,7 +1422,7 @@ async function captureAndroid(
|
||||
"-a",
|
||||
"android.intent.action.VIEW",
|
||||
"-d",
|
||||
`${APP_SCHEME}://expo-development-client/?url=${metroUrl}`,
|
||||
`'${APP_SCHEME}://expo-development-client/?url=${metroUrl}&${DEV_CLIENT_LAUNCH_FLAGS}'`,
|
||||
"--es",
|
||||
"showcasePairingUrl",
|
||||
encodeAndroidPairingUrls(pairingUrls),
|
||||
|
||||
Reference in new issue
Block a user