Last active
November 10, 2025 09:17
-
-
Save jamesob/25ac7fd62d05dc66fec5818a5f37d0f7 to your computer and use it in GitHub Desktop.
Revisions
-
jamesob revised this gist
Apr 6, 2024 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,11 @@ # This (very scant) guide allows you to do Android and react-native development on Linux by # running the android emulator in a container. # install yay via AUR git clone https://aur.archlinux.org/yay.git && cd yay && makpkg -si # install all android dev packages per https://wiki.archlinux.org/title/Android yay -Sy android-sdk-cmdline-tools-latest android-sdk-build-tools android-sdk-platform-tools android-platform # add to .zshrc if [ -d /opt/android-sdk ]; then @@ -14,14 +20,21 @@ fi cd /opt/android-sdk ./tools/bin/sdkmanager 'platforms;android-34' # Unfortunately, we need jdk-8 to sign the licenses, but we need jdk-17 to actually run react-native. # So flip back and forth. sudo pacman -Sy jre8-openjdk sudo archlinux-java set java-8-openjdk/jre # Sign the licenses sdkmanager --licenses sudo pacman -Sy jdk17-openjdk # The "--network" flag is critical to allowing the react dev server # to be accessed by the emulator container. Otherwise you'll get "couldn't hit dev server" errors. docker run -d --network host \ -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true \ --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0 adb connect $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' android-container):5555 # ensure connection adb devices -l @@ -33,3 +46,6 @@ cd YOUR_PROJECT npm start # in another terminal npm start android # Open the emulator interface open http://localhost:6080 -
jamesob created this gist
Apr 6, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ # install yay via AUR # install all android dev packages per https://wiki.archlinux.org/title/Android # add to .zshrc if [ -d /opt/android-sdk ]; then export ANDROID_HOME='/opt/android-sdk' export PATH=${PATH}:"$ANDROID_HOME/tools/bin/" export PATH=${PATH}:"$ANDROID_HOME/platform-tools/" export PATH=${PATH}:"$ANDROID_HOME/cmdline-tools/latest/bin" export PATH=${PATH}:"$ANDROID_HOME/emulator" fi # restart shell cd /opt/android-sdk ./tools/bin/sdkmanager 'platforms;android-34' sudo pacman -Sy jre8-openjdk sudo archlinux-java set java-8-openjdk/jre sdkmanager --licenses sudo pacman -Sy jdk17-openjdk docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true \ --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0 adb connect $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' android-container):5555 # ensure connection adb devices -l # Create the react app npx react-native@latest init YOUR_PROJECT cd YOUR_PROJECT npm start # in another terminal npm start android