How to change the default path of AVD?
Asked Answered
T

2

8

I am using Ubuntu 16.04.4 LTS and I want to create an AVD and store it somewhere else.

This is my android list target

 id: 1 or "android-27"
 Name: Android API 27
 Type: Platform
 API level: 27
 Revision: 1

I tried these commands

./android create avd -n androidvd -t 1 -p path/to/save/my/avd

And I get the error

Error: Flag '-t' is not valid for 'create avd'.

To fix this I tried this.

./android create avd -n androidvd -d 1 -p path/to/save/my/avd

But I am getting the error

Error: Package path (-k) not specified. Valid system image paths are:
system-images;android-25;google_apis_playstore;x86
null
Terebinthine answered 7/4, 2018 at 6:24 Comment(1)
I am still not able to figure out.Terebinthine
T
23

I have uploaded a YouTube video that shows the way to change the AVD path in Android Studio on Ubuntu. I hope that it could help you.

how to change AVD path in Android Studio on Ubuntu

Thank you.


Revised

Steps to Change the Default Path of AVD on Ubuntu

  1. In Android Studio, open AVD Manager.
    Pic1: How to open AVD Manager

  2. Create a new Virtual Device. Don't launch the AVD after created successfully.

  3. In AVD Manager, right click on the new created AVD and select "Show on Disk".
    Pic2: How to open selected AVD location
    Pic3: AVD folder content

  4. Move the folder that called "yourAVDname.avd" to your desired location.

  5. Open the INI file that called "yourAVDname.ini" using text editor, then replace the value of path with your desired location path. Save and close it after finished.
    Pic4: Replace the path with your new path

    Now you may launch the AVD from AVD Manager.

Reference:

YouTube Video: How to change AVD path in Android Studio on Ubuntu

Tunny answered 28/8, 2018 at 13:24 Comment(2)
seems good idea, but is there any better way to set default path of avd creation in ubuntu settings or in android studio settings? I am running ubuntu 20.04 with android studio v4.0.Prefiguration
Video worked for me, though there is always necessity to manually change the .avd location.Kirven
K
1

The simplest way for Ubuntu that will work also for any newly generated AVD without additional work is to

  1. Close all Android Studio windows.
  2. Move the folder ~/.android/avd to your desired location e.g.
mv ~/.android/avd /my/desired/location/avd
  1. Create a symbolic link from the new folder location to the original one, e.g.
ln -s /my/desired/location/avd ~/.android/avd
  1. Restart Android Studio
Kirstiekirstin answered 5/2 at 20:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.