Skip to content

Commit

Permalink
[BCL-Tests] Remove '-s' from _GrantPermissions (#1299)
Browse files Browse the repository at this point in the history
The [semantics of the `$(AdbTarget)` property][adb-target] are the
same as the [`adb` Target Device option][adb], which permits any of:

[adb-target]: Documentation/build_process.md
[adb]: https://developer.android.com/studio/command-line/adb.html#issuingcommands

  * `-d`: Only attached *device*.
  * `-e`: Only attached *emulator*
  * `-s SERIAL_NUMBER`: A specifically named target; needed if there
    is more than one attached device or emulator.

The problem with commit c4e8165 is that it overrode the
`$(InstallDependsOnTargets)` property to call the `_GrantPermissions`
target, which doesn't properly use `$(AdbTarget)`; it instead
*requires* using the `-s` option, which is inconsistent:

	adb -s $(AdbTarget) shell pm grant ...

Remove `-s` from the `adb` invocation so that `$(AdbTarget)` can
contain e.g. `-d` or `-e`, as is intended & documented.
  • Loading branch information
pjcollins authored and jonpryor committed Feb 13, 2018
1 parent a4ed574 commit 20b4190
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<Import Project="..\..\..\packages\NETStandard.Library.2.0.1\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\..\packages\NETStandard.Library.2.0.1\build\netstandard2.0\NETStandard.Library.targets')" />

<Target Name="_GrantPermissions">
<Exec Command="&quot;$(AdbToolPath)\adb&quot; -s $(AdbTarget) shell pm grant %(TestApkPermission.Package) android.permission.%(TestApkPermission.Identity)" />
<Exec Command="&quot;$(AdbToolPath)\adb&quot; $(AdbTarget) shell pm grant %(TestApkPermission.Package) android.permission.%(TestApkPermission.Identity)" />
</Target>

<PropertyGroup>
Expand Down

0 comments on commit 20b4190

Please sign in to comment.