Skip to content

Commit

Permalink
[tests] fix for launching emulator on Windows (dotnet#1899)
Browse files Browse the repository at this point in the history
Context: https://developer.android.com/studio/run/emulator-commandline

When attempting to use the emulator created from our build, on Windows
I commonly get an error such as:

    adb : error : failed to copy 'bin\TestDebug\Mono.Android_Tests-Signed.apk' to '/data/local/tmp/Mono.Android_Tests-Signed.apk': remote No space left on device [tests\RunApkTests.targets]

The issue seems to be there is not enough disk space allocated to
`/data/local/tmp/`.

When I look at the build log, where we start the emulator:

    [emulator stdout]   disk.cachePartition.size = 66m

It appears that only 66MB is allocated by default. I'm not sure how we
aren't hitting the same problem on other platforms.

If I add the flag `-cache-size 512`, I now see:

    [emulator stdout]   disk.cachePartition.size = 512m

And now I can properly install all of our test APKs.

NOTE: I also had to delete my emulator when testing this change. It
appears the new setting does not help unless you create a fresh
emulator?
  • Loading branch information
jonathanpeppers authored and dellis1972 committed Jun 29, 2018
1 parent 5f277c8 commit 89e3fef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void Run (string emulator)
return;

var port = string.IsNullOrEmpty (Port) ? "" : $" -port {Port}";
var arguments = $"-verbose -avd {ImageName}{port}";
var arguments = $"-verbose -avd {ImageName}{port} -cache-size 512";
Log.LogMessage (MessageImportance.Low, $"Tool {emulator} execution started with arguments: {arguments}");
var psi = new ProcessStartInfo () {
FileName = emulator,
Expand Down

0 comments on commit 89e3fef

Please sign in to comment.