Commit 9d4828a
committed
[Xamarin.Android.Build.Tasks] Fast Deployment v2.0
Fixes #5009
Fixes #5147
Fixes #4996
The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS 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 the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. 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 diectory.
The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. 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.
The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](f0d565f). This was becuase it required the use of
depreicated API's to work.
The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. 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`
Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58
New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.431 parent cdc35b6 commit 9d4828a
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