6

Is it possible to change the default path that the VS emulator is storing the .vhd files? By default it's set to store them under my %LOCALAPPDATA% folder, but that's on my C drive and I'm running out of space on C.

How can I set it to store them in D:\emulators?

Ionian316
  • 2,303
  • 2
  • 28
  • 36
  • 1
    You can find answer for similar question on http://stackoverflow.com/questions/2841766/possible-to-change-where-android-virtual-devices-are-saved – Artem Kuliyevych Mar 21 '17 at 20:47

2 Answers2

4

@Ionian316

1/ Open regedit.

2/ Go to: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudioEmulator\Android\Configuration\

3/ Find file UserConfigurationPath

4/ Input your path in here:

Default path is: %LOCALAPPDATA%\Microsoft\VisualStudioEmulator\Android

New path example: D:\VisualStudioEmulator\Android

Of course, you should copy from default path to new path for not be error.

Phong Nguyễn
  • 790
  • 2
  • 5
  • 20
0

EDIT 1

There is a solution pointed in VS Emulator for Android troubleshooting (link):

  1. Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.
  3. Modify the Path registry variable to match the path to your Android SDK.

However, this solution seems out-of-date for current available VS Emu 4 Android versions. I can not find the registry folder in the tree.

EDIT 2

Here is a simple way to do, by which I managed to change the root Path of vhd.

Situation 1: Already installed

  1. Rename folder %USERPROFILE%\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\ to something else, for backup.
  2. Create folder D:\emulators.
  3. Open cmd command-line, type in MKLINK /J %USERPROFILE%\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\ D:\emulators, press Enter.
  4. After junction made, move everything in backuped vhd folder to D:\emulators.
  5. You've done.

Situation 2: Not installed yet

  1. The steps are similar to those in Situation 1, but you do not need to rename for backup, nor move the backuped stuff to D:\emulators.
  2. You just need to make the junction, and then install VSEmu4Android.

EDIT 3

NOTE:

For proper usage of vhd's in Hyper-V (which is used by VSEmu4Android), your D:\emulators folder and files inside should not be compressed.

Alex Fang
  • 1
  • 1