Commit 7acc857
authored
[Xamarin.Android.Build.Tasks] support for $(AdbTarget) (#4166)
Fixes: https://developercommunity.visualstudio.com/content/problem/854863/unable-to-deploy-to-physical-device-when-emulator.html
Fixes: http://work.azdo.io/1056857
We got some reports that our App Bundle MSBuild tasks fail when you
have multiple devices/emulators connected to adb.
We were not using the `$(AdbTarget)` MSBuild property at all, which is
actually a slightly different parameter for `bundletool`:
--device-id: (Optional) Device serial name. If absent, this uses the
ANDROID_SERIAL environment variable. Either this flag or the environment
variable is required when more than one device or emulator is connected.
Used only if connected-device flag is set.
It appears that only a value such as `-s emulator-5554` would work for
the `--device-id` switch. To make things compatible, I think we should
just look for a space character and use the text as-is after it.
I added some tests that validate the generated command-line for
`bundletool`-related MSBuild tasks.1 parent ae70967 commit 7acc857
File tree
8 files changed
+97
-27
lines changed- src/Xamarin.Android.Build.Tasks
- Tasks
- Tests/Xamarin.Android.Build.Tests/Tasks
8 files changed
+97
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 24 | | |
35 | 25 | | |
36 | 26 | | |
| |||
72 | 62 | | |
73 | 63 | | |
74 | 64 | | |
75 | | - | |
| 65 | + | |
76 | 66 | | |
77 | | - | |
78 | 67 | | |
79 | 68 | | |
80 | 69 | | |
81 | 70 | | |
82 | 71 | | |
83 | 72 | | |
84 | 73 | | |
85 | | - | |
| 74 | + | |
86 | 75 | | |
87 | 76 | | |
88 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 38 additions & 0 deletions
| 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 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 20 | + | |
28 | 21 | | |
29 | | - | |
30 | 22 | | |
31 | 23 | | |
32 | 24 | | |
33 | | - | |
| 25 | + | |
34 | 26 | | |
35 | 27 | | |
36 | 28 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
288 | 336 | | |
289 | 337 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3264 | 3264 | | |
3265 | 3265 | | |
3266 | 3266 | | |
| 3267 | + | |
3267 | 3268 | | |
3268 | 3269 | | |
3269 | 3270 | | |
| |||
3278 | 3279 | | |
3279 | 3280 | | |
3280 | 3281 | | |
| 3282 | + | |
3281 | 3283 | | |
3282 | 3284 | | |
3283 | 3285 | | |
| |||
0 commit comments