Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Android Emulator from Shell on Ubuntu Server

I installed Android SDK and JDK on Ubuntu Server 14.04 x64. But when I run the AVD, I got

error: 'SDL init failure, reason is: No available video device'

I follow this https://stackoverflow.com/a/6965679 sudo apt-get install ia32-libs but didn't work.

Should I install any desktop on Ubuntu Server?

like image 720
sumy Avatar asked Dec 30 '15 12:12

sumy


People also ask

How do I launch an emulator in Ubuntu?

Create a new virtual device (AVD) for the platform you need. If you have to use command line for creating your AVD, you can call android create avd -n <name> -t <targetID> where targetID is the API level you need. If you can use GUI, just type in android avd and it will launch the manager, where you can do the same.

How do I run an emulator from terminal?

Use the emulator command to start the emulator, as an alternative to running your project or starting it through the AVD Manager. Here's the basic command-line syntax for starting a virtual device from a terminal prompt: emulator -avd avd_name [ {- option [ value ]} … ]

How do I open AVD Manager from terminal?

Launch AVD Manager using Command Line : Go to Run and type cmd to open command prompt window. Type: android avd. Launch AVD Manager from folder location : Browse to Android SDK folder and Double-click on AVD Manager.


1 Answers

Try to run emulator without GUI following these steps:

From: http://paulemtz.blogspot.com/2013/05/android-testing-in-headless-emulator.html

Then, to run the headless emulator:

emulator -avd test -no-skin -no-audio -no-window

The '-no-skin' option removes the emulator buttons such as the home and other hardware keyboard buttons.

The '-no-audio' option disables the audio support.

Finally, the '-no-window' option disables the emulator's graphical window display.

Note that -avd test would need to be modified to refer to your specific emulator image (AVD).

like image 89
piotrek1543 Avatar answered Oct 21 '22 04:10

piotrek1543