-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
Combining different arguments was not a documented feature. It might be working on some devices, it might be ignored on some devices. Now it throws exception on Nougat devices because Nougat has a complete new implementation for adb shell interaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -12,7 +12,7 @@ class Install extends AdbTask { | |||
if (getCustomFlags()) | |||
arguments += getCustomFlags() | |||
|
|||
arguments += ['-rd', apkPath] | |||
arguments += ['-r', '-d', apkPath] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
handleCommandOutput(command.execute().text) | ||
|
||
Process process = command.execute() | ||
if (process.waitFor() != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what you mention only works on Nougat? Would be good to add a comment about that then, imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. But it doesn't change any backward compatibility because it was always 0
before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me open a quick pr adding a comment 👍
The install task is broken on Nougat devices.
Solution
Separate the arguments so that it works on Nougat devices.
Combining different arguments was not a documented feature. It might be working on some devices, it might be ignored on some devices. Now it throws exception on Nougat devices because Nougat has a complete new implementation for adb shell interaction.
Note: Unfortunately again, it was a silent fail. It was trying to run after install fail, when we use
run
tasks.So I decided to include a code piece that I had on my stash. It checks the exit code and errors accordingly. This feature will only work on Nougat devices but still it is useful for Nougat users.
Here is the output on a failure:
This PR fixes #108