You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there are example code in order to get os version of device as belows: use cmd: getprop ro.build.version.release
AdbStream stream = adb.open("shell:");
stream.write("getprop ro.build.version.release" +'\n');
when stream read
String bufStr = new String(stream.read(), StandardCharsets.UTF_8);
//...
the output of bufStr contains some special character: like ^@, / $...
does any wrong when I use adblib?
The text was updated successfully, but these errors were encountered:
It's a problem with Android's default shell. It mixes its prompt string with the output of executed command. ^@ is the null character and / $ is the shell prompt we see on an interactive shell.
So either run like adb.open("shell:exec sh -T-") with a hope that the newly forked shell will completely daemonise. Or if you intend to run only a single command, run it directly in the non-interactive way like adb.open("shell:exec getprop ro.build.version.release").
there are example code in order to get os version of device as belows: use cmd: getprop ro.build.version.release
AdbStream stream = adb.open("shell:");
stream.write("getprop ro.build.version.release" +'\n');
when stream read
String bufStr = new String(stream.read(), StandardCharsets.UTF_8);
//...
the output of bufStr contains some special character: like ^@, / $...
does any wrong when I use adblib?
The text was updated successfully, but these errors were encountered: