Android Studio Emulator On The Mac
I am in the process of building some mobile apps for one of my clients, and while I'm pretty familiar with running the iPhone simulator and building iPhone apps, I'm pretty new to the Android development tools at this point. So I thought I would give a quick and easy guide for folks to follow, that might be interested in getting started with Android Development and running the Android Emulator.
Android Emulator not working on MAC. Ask Question Asked 2 years, 8 months ago. Active 2 months ago. Viewed 23k times 17. I've been trying to use the Android Emulator after downloading Android Studio. I've used an old Samsung S4 before, but need something compatible to Marshmallow for certain features. The problems I am seeing are.
I should mention that there is also an Eclipse Plugin for Android Development as well that you can use instead. Also, I'm using a Mac, but I think the steps should be pretty close if you are running Windows or Linux.
Step 1 - Download the Android SDK
Download the Android SDK, and unzip it somewhere. I placed the android-sdk-mac_86
folder in my /Applications/
folder, but you can put it wherever you want.
Step 2 - Optional Add to System Path
Since we are using the command line you might find it useful to add the android-sdk-platform/tools
folder to your system path so you can run the android commands from any folder. If your interested in doing that, Google provides instructions here.
Step 3 - Install Android Platforms
At this point, I tried running the emulator
command, but the SDK doesn't contain any Android Platforms, the Android platform is essentially Android OS, you need to install at least one version (eg 1.6, 2.1, 2.2, etc) to run the emulator.
To install platforms run the android
command located in the tools
folder of the SDK (use Terminal.app on a Mac, or the Command Prompt on Windows, Linux folks you know what to do :). This will pop up a window. Select Available Packages, pick some platform versions and install.
Step 4 - Create a Virtual Device
Still in the android
tool, click on Virtual Devices on the left, and then click New. Here's an example of the settings for the new device:
Once you create the avd file, it should show up in the listing of Android Virtual Devices:
Step 5 - Run the emulator
Now select the virtual device you just created and click Start on the right, and the emulator should start running:
For the past one month, i have been doing development in React Native. I am using the expo-cli to create the project and using my physical Android phone for testing. It’s time to install the Android emulator on my laptop, so that i don’t have to check my phone every-time.
For this we have to install Android Studio 3+ first, so head over to this link or google it and download.
Android Studio
It is 724 MB for mac, so will take sometime to download. Once the dmg file is downloaded, you will get the below screen. You need to drag Android Studio to Applications
Downloaded
Now, when you open Android Studio on your mac, it will show below screen. Click on Next
First
On next screen choose Standard and click on Next.
Standard
On the next screen, select any theme and click Next.
Theme
On the next screen, click Finish.
Verify Settings
On the next screen,it will start the download and will take sometime.
Downloading Components
Once the download is complete, you will see the below screen.
Finally
Click on Configure and then Preferences from drop-down.
Preferences
Goto System Settings -> Android SDK and copy the Android SDK location, somewhere.
Preferences
In the Android Studio Screen, click on Start a new Android Studio Project. Take any default setting for a project and then click on the Search icon on the top right corner. Type AVD and it will open below screen.
AVD
Once you click on +Create Virtual Device, you need to choose a device.
Device
Then you need to choose an OS from the next screen. Click on download for any latest android version.
OS
It will open the below screen and download Android image. It will take sometime as the file is huge(1 GB).
Mutants & masterminds character generator. Huge installation
Once the Download is finish, the Finish button will appear. Click on it and then the Next button on the earlier screen.
Click Next
In the next screen change the AVD Name if you want and click finish.
Finished
Next, we need to open the terminal and add two export in the .bash_profile file. Notice that the path is what was in Android SDK location
bash_profile
Next run the below command in terminal
After that in Android Studio, open the AVD Manager. It is in the top right corner and will open the Your Virtual Devices pop-up. Inside it click the run button.
Your Virtual Devices
It will open your Android emulator.
Emulator
Now, start any of your completed React-native project by npm start. If you don’t have any yet, create one using my previous blog to create a Restaurant Search React-native app here.
Click on Run on Android device/emulator and it will try to open it. First time it will also install expo app on the Android simulator.
Android emulator
If successful, you will see our restaurant app running on Android Simulator.
Restaurant app
Hope you liked this setup blog. See you soon :)