| 42 | const iosSimulatorType = detectIosSimulatorType(); |
| 43 | |
| 44 | function 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 | |
| 71 | const androidAvdName = detectAndroidAvdName(); |
| 72 | |