Setting Up Android Emulator With Android Studio Artic Fox
This tutorial is mainly to remind me how to setup Android Studio emulator for React Native.
I havent done much mobile development for while and in the past I have used Appcelerator with Genymotion for my Android development as I am on a Mac.
First of the tutorial I have been following showed a completely different version of Android Studio.
I want to download Android Studio from here https://developer.android.com/studio clicked download and Im not gonna lie didnt really understand what this meant.
I ended up clicking download options https://developer.android.com/studio#downloads and just downloading and installing the Mac (64-bit) version.
Now in the tutorial it say to go to the SDK manager from the configure button “this is not there”. I managed to find it eventually by first creating a project and then in the top menu you will see tools.
You can then install the newest version of the Android SDK.
Next problem in the tutorial it say to install Install Intel x86 Emulator Accelerator (HAXM installer).
When I check the box and try to install it fails.
Android SDK is up to date. Unable to install IntelĀ® HAXM HAXM can only be installed on Windows or Mac. Please file a bug against Android Studio. Done
Did a little search on this bug and for some reason you have to install this manually you can find the link on their GitHub page or go to this link.
https://github.com/intel/haxm/releases
Download the Mac version haxm-macosx_v7_7_0.zip you then have to cd into that folder in terminal and run.
sh silent_install.sh
Seems a bit weird right!!!! You should eventually get
Silent installation Pass!
Close Android Studio and open again.
Next issue adding the path to your bash profile. My bash profile was already full of most of the export commands from Appcelerator it looked like this.
export ANDROID_SDK=/Users/samueleast/Library/Android/sdk export ANDROID_NDK=/Users/samueleast/Library/Android/sdk/ndk-bundle export ANDROID_HOME=/Users/samueleast/Library/Android/sdk export ANDROID_SDK_ROOT=/Users/samueleast/Library/Android/sdk export ANDROID_AVD_HOME=/Users/samueleast/.android/avd export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME
Now I needed to run
adb
In the terminal for the tutorial running it didnt work for me as I am using the terminal zsh.
I needed to create a file in the same location as the bash_profile file call .zshrc
cd ~/ && touch .zshrc
Then I add the same line as above so the file looked like this.
export ANDROID_SDK=/Users/samueleast/Library/Android/sdk export ANDROID_NDK=/Users/samueleast/Library/Android/sdk/ndk-bundle export ANDROID_HOME=/Users/samueleast/Library/Android/sdk export ANDROID_SDK_ROOT=/Users/samueleast/Library/Android/sdk export ANDROID_AVD_HOME=/Users/samueleast/.android/avd export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME
Now I typed abd in terminal and nothing happened!!!!!! You need to run.
source ~/.zshrc
Then finally adb worked.
Android Debug Bridge version 1.0.41 Version 31.0.3-7562133 Installed as /Users/samueleast/Library/Android/sdk/platform-tools/adb
Finally I can now open up Android studio and install my AVD Virtual Device.
Seems some thing have not changed with cross platform development setup is the biggest pain in the arse.
In the tutorial the guy is amazed by the live refresh seems strange when Appc was doing this more than 5 years ago.