[tests] Avoid using adb install -r
#429
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@xmcclure and I just spent hours trying to figure out why a
Xamarin.Android unit test was failing on her device, but nowhere else,
and -- further! -- how when she added new tests to the
Xamarin.Android.JcwGen_Tests
package, the new tests and new debugmessages would never appear on
adb logcat
.The result? An old install. Apparently,
wasn't actually installing updated file contents.
Manually uninstalling the
Xamarin.Android.JcwGen_Tests
package andinstalling a new
Xamarin.Android.JcwGen_Tests-Signed.apk
resulted inall tests passing, as expected.
What this means to me is that
adb install -r
can't be trusted.We pulled our hair out for hours trying to figure out why various
things didn't appear to work at all, and nothing worked because we
were never getting the new app on her device.
(Insert fuming here.)
Consequently, avoid
adb install -r
. Instead, update the$(RunApkTestsDependsOn)
property so that we always call theUndeployUnitTestApks
target before calling theDeployUnitTestApks
target, and update the
DeployUnitTestApks
target to use "normal"adb install
instead ofadb install -r
.