expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.6k stars 477 forks source link

Change ADB path in Expo #4776

Closed looney-toon closed 6 months ago

looney-toon commented 8 months ago

Summary

I have a different path for AndroidSDK but I am unable to use that adb path in expo, whenever I try to open it on android by pressing a in cli it gives the following error:

Error: 'C:\Users\USER\AppData\Local\Android\Sdk\platform-tools\adb' is not recognized as an internal or external command,
operable program or batch file.

There should be a way to change the adb path to match wherever AndroidSDK is located for a user.

Environment

expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.22621 Binaries: Node: 20.9.0 - C:\Program Files (x86)\nodejs\node.EXE npm: 10.2.1 - C:\Program Files (x86)\nodejs\npm.CMD IDEs: Android Studio: AI-223.8836.35.2231.10811636 npmPackages: expo: ~49.0.15 => 49.0.16 react: 18.2.0 => 18.2.0 react-native: 0.72.6 => 0.72.6 Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

Windows

Error output

No response

Reproducible demo or steps to reproduce from a blank project

expo start

byCedric commented 6 months ago

Hi @looney-toon! Expo uses the default ANDROID_HOME or ANDROID_SDK_ROOT environment variables. If you define these in your environment, we pick this up automatically (just as normal Android development tools would do).

See https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/start/platforms/android/AndroidSdk.ts#L22-L49