MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getArchitectureForAndroidDevice

Function getArchitectureForAndroidDevice

npm_modules/cli/src/utils/deviceUtils.ts:14–36  ·  view source on GitHub ↗
(deviceId: string)

Source from the content-addressed store, hash-verified

12}
13
14export async function getArchitectureForAndroidDevice(deviceId: string): Promise<Architecture> {
15 const { stdout } = await runCliCommand(`adb -s ${deviceId} shell getprop ro.product.cpu.abi`, undefined, true);
16
17 const architectureString = stdout.trim();
18
19 switch (architectureString) {
20 case 'arm64-v8a': {
21 return Architecture.ARM64;
22 }
23 case 'armeabi-v7a': {
24 return Architecture.ARMV7;
25 }
26 case 'armeabi': {
27 return Architecture.ARMV7;
28 }
29 case 'x86_64': {
30 return Architecture.X86_64;
31 }
32 default: {
33 throw new CliError(`Unsupported device architecture: ${architectureString}`);
34 }
35 }
36}
37
38export function getAllArchitecturesForAndroid() {
39 return [Architecture.ARM64, Architecture.ARMV7, Architecture.X86_64];

Callers 1

getBuildInfoFunction · 0.90

Calls 2

runCliCommandFunction · 0.90
trimMethod · 0.45

Tested by

no test coverage detected