Added option to run ADB in no-streaming mode
ADB can install an app either directly from the host ("streamed install"), or by copying the APK to the device and then running the installation process. The former is the current default, but the latter is still needed for some devices. Added an option allowing streamed install to be disabled.
PR Checklist:
- [x] All new features have been tested
- [x] All new features have been documented
- [x] I have read the CONTRIBUTING.md file
- [x] I will abide by the code of conduct
In my experience ADB always chooses the mode automatically based on the version of the device. Why would you need to override that?
In my experience ADB always chooses the mode automatically based on the version of the device.
That's not always the case. For example, it's an ongoing issue in LineageOS. That's actually what motivated me to write this patch.
OK, but since this is a rare issue, I don't think it justifies adding a specific Briefcase argument. Instead, we could create an --Xadb-install argument which follows the pattern of the existing --Xemulator, allowing anything to be passed through to the subprocess.
OK, but since this is a rare issue, I don't think it justifies adding a specific Briefcase argument. Instead, we could create an
--Xadb-installargument which follows the pattern of the existing--Xemulator, allowing anything to be passed through to the subprocess.
I agree. This seems like a very specific niche workaround for a specific Linux distro, not something that needs a generic capability added to Briefcase. However, adb does take a lot of options, and some of them may be useful under edge-case circumstances, so we should provide a generic mechanism to expose those options.
I replaced the --no-streaming option with the more general --Xadb-install as discussed, but now I'm getting a coverage error in the CI / unit test suite. I'm having trouble understanding what the exact issue is; I suppose this means I need to add more tests for the new option, but how do I know what the coverage system is looking for?
OK, I seem to have figured a way to placate the code coverage system, though to be honest I'm still not sure what was wrong with the previous version of the code.
OK, I seem to have figured a way to placate the code coverage system, though to be honest I'm still not sure what was wrong with the previous version of the code.
FWIW: The coverage gap was reported as 1503->1506. This is telling you about branch coverage - the branch that jumps from line 1503 to line 1506 (i.e., the implicit else: pass that was part of the original if extra_args is None statement).
If you just have line coverage, calling the method with extra_args = None will cover every line of code that is written. With branch coverage, you also need to cover the implicit else: pass case, to ensure that you've tested every way the code can be used.
This isn't picked up when you convert the line into an inline ternary statement, due to a bug/missing feature in how coverage works - but it should ideally still have a test case.