进入模式有时候不太好,比如是某程序执行的,需要执行就立马结束,就需要用到-c了
首先新建termux.sh adb push /data/local/tmp/ 移动到/sbin 给与可执行权限.
#!/system/bin/sh
echo 您传入的参数是:$*
echo adb shell su -c termux.sh 进入模式
echo adb shell su -c termux.sh -c ls 通过termux.sh执行并退出.
su $(stat -c %u /data/data/com.termux) /data/data/com.termux/files/home/bin/termux-shell.sh $
下面是测试效果
可以看到执行后立马结束了
![[原创]termux adb 高级玩法结合程序执行批处理666_linux](https://file.cfanz.cn/uploads/png/2022/12/30/17/f58SHV25A6.png)
image.png
下面是直接进入模式
![[原创]termux adb 高级玩法结合程序执行批处理666_服务器_02](https://file.cfanz.cn/uploads/png/2022/12/30/17/fY3B71c40H.png)
image.png
然后我输入类似 ls init*并没有退出
