Skip to content

Commit 97985fb

Browse files
fix(mobile): keep store screenshots free of system banners and show dictation
The showcase runner boots eligible iOS 26 simulators that post a "Ready for Apple Intelligence" follow-up banner on first boot, and CoreFollowUp keeps re-surfacing it on every boot until someone dismisses it, so captures shipped with the banner over the status bar. The runner now stamps the readiness marker generativeexperiencesd checks and drops the CoreFollowUp store before booting, which both prevents the post and clears one a previous boot queued. Simulators cannot run on-device transcription, so the composer hid the dictation button in every capture. The app now reports dictation as available whenever the showcase runner launched it with a scene. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent dddc0bd commit 97985fb

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

‎apps/mobile/src/features/voice-input/useVoiceInputController.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { useSharedValue } from "react-native-reanimated";
1414

1515
import type { ComposerEditorSelection } from "../../components/ComposerEditor";
1616
import { getLocalVoiceTranscriber } from "../../native/voiceTranscription";
17+
import { getNativeShowcaseScene } from "../showcase/nativeShowcaseScene";
1718
import {
1819
VoiceInputController,
1920
VOICE_RECORDING_LIMIT_SECONDS,
@@ -203,7 +204,9 @@ export function useVoiceInputController(input: {
203204
const cancel = useCallback(() => controller.cancel(), [controller]);
204205

205206
return {
206-
isAvailable: getLocalVoiceTranscriber() !== null,
207+
// Store screenshots show the dictation button even on simulators, whose
208+
// on-device transcription is unavailable.
209+
isAvailable: getLocalVoiceTranscriber() !== null || getNativeShowcaseScene() !== null,
207210
state,
208211
audioLevels,
209212
elapsedSeconds,

‎scripts/mobile-showcase.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,47 @@ async function ensureIosSimulator(device: ShowcaseIosDevice): Promise<{
806806
};
807807
}
808808

809+
async function iosSimulatorDataPath(udid: string): Promise<string> {
810+
const parsed = JSON.parse(await commandOutput("xcrun", ["simctl", "list", "devices", "-j"])) as {
811+
readonly devices: Readonly<
812+
Record<string, ReadonlyArray<SimctlDevice & { readonly dataPath: string }>>
813+
>;
814+
};
815+
const dataPath = Object.values(parsed.devices)
816+
.flat()
817+
.find((device) => device.udid === udid)?.dataPath;
818+
if (!dataPath) throw new Error(`Could not resolve the data path of iOS simulator ${udid}.`);
819+
return dataPath;
820+
}
821+
822+
// generativeexperiencesd posts a "Ready for Apple Intelligence" follow-up
823+
// banner on an eligible device's first boot, and CoreFollowUp re-surfaces it
824+
// on every boot until the user dismisses it. Stamping the readiness marker
825+
// before boot makes the daemon skip the post, and dropping the CoreFollowUp
826+
// store clears a banner that a previous boot already queued. Runs while the
827+
// device is shut down so the files are read fresh on the next boot.
828+
async function suppressIosSystemFollowUps(udid: string): Promise<void> {
829+
const dataPath = await iosSimulatorDataPath(udid);
830+
const preferences = NodePath.join(dataPath, "Library/Preferences");
831+
await NodeFSP.mkdir(preferences, { recursive: true });
832+
await NodeFSP.writeFile(
833+
NodePath.join(preferences, "com.apple.generativeexperiences.corefollowup.plist"),
834+
`<?xml version="1.0" encoding="UTF-8"?>
835+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
836+
<plist version="1.0">
837+
<dict>
838+
\t<key>DateOfLastAppleIntelligenceReadinessCFU</key>
839+
\t<date>2020-01-01T00:00:00Z</date>
840+
</dict>
841+
</plist>
842+
`,
843+
);
844+
await NodeFSP.rm(NodePath.join(dataPath, "Library/CoreFollowUp"), {
845+
recursive: true,
846+
force: true,
847+
});
848+
}
849+
809850
async function normalizeIosSimulator(appearance: ShowcaseAppearance, udid: string): Promise<void> {
810851
await runCommand("xcrun", ["simctl", "ui", udid, "appearance", appearance]);
811852
await runCommand("xcrun", [
@@ -922,6 +963,7 @@ async function captureIos(
922963
// confirmations, keyboards) without erasing the developer's simulator.
923964
await runCommand("xcrun", ["simctl", "shutdown", simulator.udid]);
924965
}
966+
await suppressIosSystemFollowUps(simulator.udid);
925967
await runCommand("xcrun", ["simctl", "boot", simulator.udid]);
926968
await runCommand("xcrun", ["simctl", "bootstatus", simulator.udid, "-b"]);
927969
if (capture.device.orientation === "landscape") {

0 commit comments

Comments
 (0)