MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / detectAndroidAvdName

Function detectAndroidAvdName

Example/testHotUpdate/.detoxrc.js:44–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42const iosSimulatorType = detectIosSimulatorType();
43
44function detectAndroidAvdName() {
45 if (process.env.DETOX_AVD_NAME) {
46 return process.env.DETOX_AVD_NAME;
47 }
48
49 if (process.platform !== 'darwin' && process.platform !== 'linux') {
50 return 'Pixel_3a_API_33_arm64-v8a';
51 }
52
53 try {
54 const output = execSync('emulator -list-avds', {
55 stdio: ['ignore', 'pipe', 'ignore'],
56 }).toString();
57 const avds = output
58 .split('\n')
59 .map(line => line.trim())
60 .filter(Boolean);
61 if (avds.length > 0) {
62 return avds[0];
63 }
64 } catch {
65 // fall through to default
66 }
67
68 return 'Pixel_3a_API_33_arm64-v8a';
69}
70
71const androidAvdName = detectAndroidAvdName();
72

Callers 1

.detoxrc.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected