In my script I have the following code:
for /f "delims=" %%a in ('adb -s devicename shell su') do @set res=%%a
echo %res%
But I get no output. How to properly check for su
availability from a batch
script?
set uid=
for /f "delims=" %%a in ('adb -s devicename shell "su 0 id -u 2>/dev/null"') do set uid=%%a
echo %uid%
%uid%
will be 0
if su
is available