As the name implies, Android emulator enables you to test-run Android apps on non-Android devices or computers running the emulator.
Here is guide on how to run Android emulator on Ubuntu or Debian.
Android emulator comes with Android SDK, and therefore you need to install Android SDK. Follow the steps below to install Android SDK on Linux.
Android SDK requires Java JDK. Therefore install Java JDK first.
To install Java JDK on Ubuntu or Debian:
To install Java JDK on CentOS, Fedora or RHEL, first set up Repoforge repository on your system, and then run the following.
Now download Android SDK ADT bundle from Android official site. Unzip the downloaded ADT bundle, and copy the sdk directory to your preferred location. Here I assume that the installation directory of Android SDK is ~/android-sdks.
For 64-bit Linux user: you must install another prerequisite called ia32-libs since Android emulator is 32-bit software. The ia32-libs package contains a set of runtime libraries for the ia32/i386 architecture, configured for use on a 64-bit kernel. On 64-bit Linux, the mksdcard utility which creates SD cards will fail without this package.
While using ia32-libs, if you encounter any error with 32-bit libGL.so, do the following:
In order to run Android emulator, you first need to create a new AVD (Android Virtual Device) which is an emulator configuration for the Android device to be emulated. To create a new AVD, first launch Android SDK Manager by running the following.
Go to "Tools" > "Manage AVDs" on Android SDK Manager's menu. It will open up AVD Manager.
Click on "Add" button to create a new AVD. An example configuration of a new AVD is shown below.
If an AVD has been successfully created, you will see the following confirmation.
You can check the list of available AVDs as follows.
Available Android Virtual Devices: Name: my_avd Path: /home/xmodulo/.android/avd/my_avd.avd Target: Android 4.2 (API level 17) ABI: armeabi-v7a Skin: 800x1280 Sdcard: 1G
To launch Android emulator with the AVD that you have created, highlight the AVD on AVD Manager, and click on "Start" button on the right sidebar.
Alternatively, you can start Android emulator directly from command line as follows. In this case, specify "@[your_avd_name]" as an argument to the emulator.
Booting up Android emulator may be slow (even taking minutes) depending on your hardware. Once Android emulator is successfully launched, you will see an running instance of Android device.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!