Commit 0304643
committed
[Microsoft.Android.Run] Add simple console app for
Fixes: #10645
For alignment with other platforms, including `dotnet new console`,
`dotnet run` for Android should:
* Show console output for the launched process
* Exit if the app closes
* Close the app on Ctrl+C
A one-liner like this is *close*:
adb shell 'am start -S -W -n "PACKAGE/ACTIVITY"; pid=$(pidof PACKAGE); logcat --pid=$pid'
But then Ctrl+C does not close the app, so to wire this all together,
add a simple console app to be invoked by `dotnet run`.
We do not initially intend for this app to be run directly by users,
so it is placed in the `tools` folder of the SDK pack and not a .NET
global tool.
New MSBuild properties:
`$(WaitForExit)`
* Default: (empty)
* When `false`, allow users to disable waiting for the app to exit,
which is useful for our existing tests.
`$(_AndroidRunPath)`
* Default: `$(MSBuildThisFileDirectory)..\tools\Microsoft.Android.Run.dll`
* Allows overriding the path to the `Microsoft.Android.Run` assembly.
`$(_AndroidRunExtraArgs)`
* Default: (empty)
* Allows extra args like `--verbose` passed indotnet run
1 parent 17c5317 commit 0304643
File tree
9 files changed
+566
-23
lines changed- Documentation/docs-mobile/building-apps
- build-tools/create-packs
- src
- Microsoft.Android.Run
- Xamarin.Android.Build.Tasks
- Microsoft.Android.Sdk/targets
- Tests/Xamarin.ProjectTools/Common
- tests/MSBuildDeviceIntegration/Tests
9 files changed
+566
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1819 | 1819 | | |
1820 | 1820 | | |
1821 | 1821 | | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
| 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 | + | |
0 commit comments