Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Android emulator completely via command line #13

Open
karlhorky opened this issue Apr 12, 2022 · 0 comments
Open

Set up Android emulator completely via command line #13

karlhorky opened this issue Apr 12, 2022 · 0 comments
Assignees

Comments

@karlhorky
Copy link
Member

karlhorky commented Apr 12, 2022

Without installing Android Studio - using:

  • the New Command Line Tools
  • sdkmanager
  • avdmanager
  • emulator

Potentially useful references:

But getting a working Windows guide may be challenging, maybe it needs manual PATH:

https://www.maketecheasier.com/install-android-sdk-in-windows/

First Notes

# create an issue with these commands - maybe we can get a full working command-line version in the future:

# watchman recommended by React Native docs https://reactnative.dev/docs/environment-setup
# todo: do we need watchman??
brew install watchman
# or, on m1
arch -arm64 brew install watchman

# Version recommended by React Native docs https://reactnative.dev/docs/environment-setup
brew tap homebrew/cask-versions
brew install --cask zulu11

brew install qt
brew install --cask temurin8 android-sdk

brew install --cask temurin11 android-commandlinetools
yes | sdkmanager --licenses
sdkmanager --install "build-tools;32.0.0" platform-tools "platforms;android-30"
sdkmanager --install emulator

This will install the Java JDK, Android Command Line tools and the Android emulator.

If you have a machine with an M1 chip, run the following two lines:

sdkmanager --install "system-images;android-30;aosp_atd;arm64-v8a"
avdmanager create avd --name Pixel_3a_API_30_AOSP --abi "aosp_atd/arm64-v8a" --package "system-images;android-30;aosp_atd;arm64-v8a" --device "pixel_3a"

If you have a machine WITHOUT an M1 chip, run the following two lines:

sdkmanager --install "system-images;android-30;aosp_atd;x86"
avdmanager create avd --name Pixel_3a_API_30_AOSP --abi "aosp_atd/x86" --package "system-images;android-30;aosp_atd;x86" --device "pixel_3a"

To start the emulator, run this:

$HOME/Library/Android/sdk/emulator/emulator -avd Pixel_3a_API_30_AOSP

https://docs.expo.dev/workflow/android-studio-emulator/

Some additional things that may help you:

  1. The React Native CLI Quickstart tab on the React Native environment setup docs
  2. Running npx react-native doctor
@karlhorky karlhorky self-assigned this Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant