Skip to content

Commit f7ef418

Browse files
committed
feat(cloud): add --render-engine for the emulator software renderer
Android-only, lavapipe or swiftshader, validated client-side. Omitted leaves the choice to the server, which detects the Flutter engine in the binary and picks swiftshader for it; the flag is the override for when that guess is wrong or an app needs the other renderer.
1 parent 075a0be commit f7ef418

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/commands/cloud.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const DOWNLOAD_OPTIONS = ['ALL', 'FAILED'] as const;
8686
const REPORT_OPTIONS = ['allure', 'html', 'html-detailed', 'junit'] as const;
8787
const ORIENTATION_OPTIONS = ['0', '90'] as const;
8888
const RUNNER_TYPE_OPTIONS = ['default', 'm4', 'm1', 'gpu1', 'cpu1'] as const;
89+
const RENDER_ENGINE_OPTIONS = ['lavapipe', 'swiftshader'] as const;
8990

9091
/**
9192
* Primary CLI command for executing tests on DeviceCloud.
@@ -257,6 +258,11 @@ export const cloudCommand = defineCommand({
257258
RUNNER_TYPE_OPTIONS,
258259
'runner-type',
259260
) ?? 'default';
261+
const renderEngine = validateEnum(
262+
args['render-engine'] as string | undefined,
263+
RENDER_ENGINE_OPTIONS,
264+
'render-engine',
265+
);
260266
const showCrosshairs = Boolean(args['show-crosshairs']);
261267
const maestroChromeOnboarding = Boolean(args['maestro-chrome-onboarding']);
262268
const disableAnimations = Boolean(args['disable-animations']);
@@ -838,6 +844,7 @@ export const cloudCommand = defineCommand({
838844
showCrosshairs,
839845
maestroChromeOnboarding,
840846
disableAnimations,
847+
renderEngine,
841848
});
842849

843850
// Device-matrix cost preview: the server prices the exact fan-out (quote

src/config/flags/device.flags.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export const deviceFlags = {
2424
type: 'string',
2525
description: `[Android only] Android device to run your flow against (options: ${androidDevices})`,
2626
},
27+
'render-engine': {
28+
type: 'string',
29+
description:
30+
'[Android only] Software renderer the emulator boots with (options: lavapipe, swiftshader). Defaults to lavapipe; pick swiftshader if your app fails to render or the device drops out mid-run. Apps shipping the Flutter engine are detected and switched automatically, so this is only needed to override that.',
31+
},
2732
'device-locale': {
2833
type: 'string',
2934
description:

src/services/test-submission.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export interface TestSubmissionConfig {
4444
name?: string;
4545
orientation?: string;
4646
raw?: unknown;
47+
/**
48+
* Which emulator software renderer to boot with (Android only). Omitted
49+
* means the server decides: lavapipe by default, or swiftshader when the
50+
* binary is detected as shipping the Flutter engine.
51+
*/
52+
renderEngine?: 'lavapipe' | 'swiftshader';
4753
report?: string;
4854
retry?: number;
4955
runnerType?: string;
@@ -93,6 +99,7 @@ export class TestSubmissionService {
9399
orientation,
94100
retry,
95101
continueOnFailure = true,
102+
renderEngine,
96103
report,
97104
showCrosshairs,
98105
maestroChromeOnboarding,
@@ -281,6 +288,7 @@ export class TestSubmissionService {
281288
maestroVersion,
282289
orientation,
283290
raw: JSON.stringify(raw),
291+
renderEngine,
284292
report,
285293
showCrosshairs,
286294
maestroChromeOnboarding,

0 commit comments

Comments
 (0)