Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Documentation/guides/BuildProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ Install properties control the behavior of the `Install` and
MSBuild /t:Install ProjectName.csproj /p:AdbTarget=-e
```

- **AndroidAllowDeltaInstall** – Enable experimental APK delta install support,
which computes a diff between the currently install APK and new one and only sends the diffs, not
whole APK, to the device. If delta install isn't available (the app wasn't previously
installed or the device is older than API 24) or the delta install fails, it falls back
to a regular install. The default value is `false`.

**Experimental**. Added in Xamarin.Android 10.5.

### Packaging Properties

Packaging properties control the creation of the Android package, and are
Expand Down
12 changes: 12 additions & 0 deletions Documentation/release-notes/4643.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Add `$(AndroidAllowDeltaInstall)` MSBuild Property

The new `$(AndroidAllowDeltaInstall)` MSBuild property can be used to
enable the experimental delta install feature, which computes a diff
between the currently installed APK and new one and only sends the diffs, not
whole APK, to the device. Delta installs can be slightly faster.
If delta install isn't available (the app wasn't previously installed
or the device is older than API 24) or the delta install fails, it falls back
to a regular install.

The default value is `false`. Note that this feature is currently experimental,
just intended for testing and not yet recommended for normal use.
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="dotnet internal feed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" protocolVersion="3" />

<!-- This is needed (currently) for the Xamarin.Android.Deploy.Installer dependency, getting the installer -->
<!-- Android binary, to support delta APK install -->
<add key="xamarin.android util" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/Xamarin.Android/nuget/v3/index.json" />
</packageSources>
<config>
<add key="globalPackagesFolder" value="packages" />
Expand Down
6 changes: 6 additions & 0 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Build.Debugging.Tasks.pdb" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Common.Debugging.props" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Common.Debugging.targets" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\arm64-v8a\installer" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\armeabi-v7a\installer" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\x86\installer" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\x86_64\installer" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\protobuf-net.dll" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\System.Collections.Immutable.dll" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Tools.ResourceProcessors.dll" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.AndroidTools.dll" />
<_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.AndroidTools.pdb" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static class KnownProperties
public const string OutputType = "OutputType";
public const string AndroidFastDeploymentType = "AndroidFastDeploymentType";
public const string AndroidClassParser = "AndroidClassParser";
public const string AndroidAllowDeltaInstall = "AndroidAllowDeltaInstall";
}
}

16 changes: 15 additions & 1 deletion tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -276,39 +276,51 @@ public override void OnCreate ()
/* useSharedRuntime */ false,
/* embedAssemblies */ true,
/* fastDevType */ "Assemblies",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ false,
/* embedAssemblies */ false,
/* fastDevType */ "Assemblies",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ true,
/* embedAssemblies */ true,
/* fastDevType */ "Assemblies",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ true,
/* embedAssemblies */ false,
/* fastDevType */ "Assemblies",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ true,
/* embedAssemblies */ true,
/* fastDevType */ "Assemblies:Dexes",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ true,
/* embedAssemblies */ false,
/* fastDevType */ "Assemblies:Dexes",
/* allowDeltaInstall */ false,
},
new object[] {
/* useSharedRuntime */ true,
/* embedAssemblies */ false,
/* fastDevType */ "Assemblies",
/* allowDeltaInstall */ true,
},
};
#pragma warning restore 414

[Test]
[TestCaseSource (nameof(DebuggerTestCases))]
[Retry (1)]
public void ApplicationRunsWithDebuggerAndBreaks (bool useSharedRuntime, bool embedAssemblies, string fastDevType)
public void ApplicationRunsWithDebuggerAndBreaks (bool useSharedRuntime, bool embedAssemblies, string fastDevType, bool allowDeltaInstall)
{
if (!CommercialBuildAvailable) {
Assert.Ignore ("Test does not run on the Open Source Builds.");
Expand All @@ -326,6 +338,8 @@ public void ApplicationRunsWithDebuggerAndBreaks (bool useSharedRuntime, bool em
};
var abis = new string [] { "armeabi-v7a", "x86" };
proj.SetProperty (KnownProperties.AndroidSupportedAbis, string.Join (";", abis));
if (allowDeltaInstall)
proj.SetProperty (KnownProperties.AndroidAllowDeltaInstall, "true");
proj.SetDefaultTargetDevice ();
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
SetTargetFrameworkAndManifest (proj, b);
Expand Down