Commit 71dc718
authored
[Xamarin.Android.Build.Tasks] Fast Deployment v2.0 (#4690)
Fixes: #4996
Fixes: #5009
Fixes: #5147
Changes: xamarin/monodroid@1ac5333...767f647
* xamarin/monodroid@767f64715: [msbuild] Fast Deployment v2.0 (#1090)
* xamarin/monodroid@0f04ba56d: Merge pull request #1115 from xamarin/remove-xreitem
* xamarin/monodroid@d75341fc3: Remove provisionator file completely
* xamarin/monodroid@b62e8c693: Replace XreItem with supported Xcode and JavaJDK syntax
The Fast Deployment system used for debugging Xamarin.Android apps has
been completely re-written. This is mostly due to changes in Android
which means we can no longer use the external storage directory to
store assemblies.
Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the `.apk` will mostly
not need to be re-installed during a debugging/development session.
Instead the assemblies are "Fast Deployed" to a special directory where
a debug version of our runtime knows where to find them.
Historically this was on the external storage directory such as
/storage/emulated/0/Android/data/com.some.package
/mnt/shell/emulated/0/Android/data/com.some.package
/storage/sdcard/Android/data/com.some.package
With Android 11, these directories are no longer accessible. Instead,
we need to deploy the assemblies into the app's internal `files`
directory. This is usually located in `/data/data/@PACKAGE_NAME@`.
This is not a global writable folder, so we need to use the `run-as`
tool to run all the commands to copy the files into that directory.
The `run-as` tool does not always work on older devices. From this
point on Fast Deployment v2 will only be available on API-21+ devices.
If a certain device does not support the `run-as` tool, then you can
always fall back to debugging without Fast Deployment. While this is
slower, it should still work on most devices.
[`$(AndroidFastDeploymentType)`][0] is still supported. This will
deploy both assemblies, native libraries, typemaps, and `.dex` files to
the `files` directory. Support for Fast Deploying Android resources
and assets was removed in commit f0d565f, as it required the use of
deprecated API's to work.
The Shared Runtime has also be removed in this new system. Previously,
we used to deploy the BCL and API specific assemblies via separate
`.apk` files. This new system removes the need for that. All the BCL
and API specific assemblies will be deployed to the `files` directory
like all the other assemblies.
The new system is on par with the existing system when it comes to
speed. More improvements are planned in future releases which should
make it much quicker.
Using the `samples\HelloWorld` project these are the performance
differences using `HelloWorld.csproj /restore /t:Install /v:n`:
* Deploy "from Clean"
* v1: 00:00:11.42
* v2: 00:00:11.78 [3% longer]
* Incrementally deploy C#-based change
* v1: 00:00:02.58
* v2: 00:00:02.43 [6% faster]
[0]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidfastdeploymenttype1 parent a7ef6e9 commit 71dc718
File tree
101 files changed
+412
-664
lines changed- .vscode
- Documentation
- guides
- building-apps
- messages
- release-notes
- build-tools/installers
- samples/HelloWorld
- HelloLibrary
- src-ThirdParty/bazel/java/mono/android/debug
- src
- Mono.Android/Test
- OpenTK-1.0
- Xamarin.Android.Build.Tasks
- MSBuild/Xamarin/Android
- Microsoft.Android.Sdk/targets
- Properties
- xlf
- Resources
- Tasks
- Tests
- Xamarin.Android.Build.Tests
- Utilities
- Xamarin.ProjectTools
- Android
- Common
- Utilities
- java-runtime/java/mono/android
- monodroid/jni
- tests
- BCL-Tests
- LocalTests.NUnit
- Xamarin.Android.Bcl-Tests
- CodeGen-Binding
- Xamarin.Android.FixJavaAbstractMethod-APIv1Binding
- Xamarin.Android.FixJavaAbstractMethod-APIv2Binding
- Xamarin.Android.FixJavaAbstractMethod-Library
- Xamarin.Android.JcwGen-Tests
- Xamarin.Android.LibraryProjectZip-LibBinding
- Xamarin.Android.McwGen-Tests
- CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests
- EmbeddedDSOs/EmbeddedDSO
- MSBuildDeviceIntegration/Tests
- ResolveImports
- Xamarin.Android.BindingResolveImportLib1
- Xamarin.Android.BindingResolveImportLib2
- Xamarin.Android.BindingResolveImportLib3
- Xamarin.Android.BindingResolveImportLib4
- Xamarin.Android.BindingResolveImports-Tests
- Runtime-AppBundle
- Runtime-MultiDex
- TestRunner.Core
- TestRunner.NUnit
- TestRunner.xUnit
- Xamarin.Forms-Performance-Integration/Droid
- locales
- LibraryResources
- Xamarin.Android.Locale-Tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
101 files changed
+412
-664
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 39 | | |
53 | 40 | | |
54 | 41 | | |
55 | 42 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
63 | 50 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
67 | 58 | | |
68 | 59 | | |
69 | 60 | | |
70 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
| |||
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
436 | | - | |
437 | | - | |
| 438 | + | |
| 439 | + | |
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
| |||
1003 | 1009 | | |
1004 | 1010 | | |
1005 | 1011 | | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | 1012 | | |
1019 | 1013 | | |
1020 | 1014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
233 | 242 | | |
234 | 243 | | |
235 | 244 | | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments