我该怎么$?
办adb shell <command>
?
我想检查adb shell mkdir /xxx
.
我执行mkdir
命令 byadb shell
并失败,但结果$?
是0
.
$ adb shell mkdir /xxx
mkdir failed for /xxx, Read-only file system
$ adb shell echo $?
0
$ adb shell "mkdir /xxx; echo $?"
mkdir failed for /xxx, Read-only file system
0
我想获得结果代码,adb shell <command>
但不是在交互模式下,如下所示:
$ adb shell
shell@android:/ $ mkdir /xxx
mkdir failed for /xxx, Read-only file system
255|shell@android:/ $ echo $?
255