How to Open The Avd Manager on Ubuntu Linux from The Command Line

How do I launch the Android emulator from the command line?

I assume that you have built your project and just need to launch it, but you don't have any AVDs created and have to use command line for all the actions. You have to do the following.

  1. 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. You can read more about AVD management through GUI and through command line.
  2. Run the AVD either by using command emulator -avd <name> or through previously launched GUI. Wait until the emulator fully loads, it takes some time. You can read about additional options here.
  3. Now you have to install the application to your AVD. Usually during development you just use the same Ant script you used to build the project, just select install target. However, you can install the application manually using command adb install <path-to-your-APK>.
  4. Now switch to emulator and launch your application like on any normal device, through the launcher. Or, as an alternative, you can use the following command: adb shell am start -a android.intent.action.MAIN -n <package>/<activity class>. For example: adb shell am start -a android.intent.action.MAIN -n org.sample.helloworld/org.sample.helloworld.HelloWorld. As a commenter suggested, you can also replace org.sample.helloworld.HelloWorld in the line above with just .HelloWorld, and it will work too.

Android: How to launch emulator from command line?

Open command prompt anywhere and use the following command

  • To get the list of available emulator

    emulator -list-avds

  • To open a emulator

    emulator -avd Nexus_5X_API_23

Mac Terminal - How to start Android Virtual Device Manager on CLI?

Use the Android SDK Tools:

avdmanager

Or you can also start it by using the command below but it's deprecated though on newer version. Before executing it, make sure to export your Android SDK's tools directory in your ~/.bash_profile (i.e. export PATH="/Users/user/Software/android-sdk-macosx/tools:$PATH")

android avd

Old answer:

In order to open the avd manager on terminal, execute the following:

/usr/bin/java -Xmx256M -XstartOnFirstThread \
-Dcom.android.sdkmanager.toolsdir=/path/of/android-sdk-macosx/tools \
-classpath /path/of/android-sdk-macosx/tools/lib/sdkmanager.jar:/path/of/android-sdk-macosx/tools/lib/swtmenubar.jar:/path/of/android-sdk-macosx/tools/lib/x86_64/swt.jar \
com.android.sdkmanager.Main avd

How to create Android Virtual Device with command line and avdmanager?

If you don't care about it being a Nexus 6P, you can run

echo no | Android/Sdk/tools/bin/avdmanager create avd --force --name testAVD --abi google_apis/x86_64 --package 'system-images;android-23;google_apis;x86_64'

Why AVD Manager options are not showing in Android Studio

I had installed Android studio and was not able to access the AVD Manager directly. I had to follow the steps as mentioned below:

  1. Created a blank project using Android Studio
  2. Once the Project is ready to use I tried open action using the shortcut ctrl+shift+a option and searched for AVD Manager
    AVD Manager
  3. On double clicking the AVD Manager I got a few errors in console about the missing libararies along with the link to install the neccessary dependencies. On clicking the links which was displayed with the error message few packages which were needed were installed. Once all the required packages were installed the AVD Manager icon becomes active.

Sample Image



Related Topics



Leave a reply



Submit