Android 使用批处理文件在linux shell中运行命令

Android 使用批处理文件在linux shell中运行命令,android,linux,shell,batch-file,Android,Linux,Shell,Batch File,我需要能够在连接到PC的根安卓手机上运行以下命令: su mount -o rw,remount /system chmod 777 /system/app/ exit exit 然后我需要在我的电脑上执行以下命令: adb push ..\bin\MyApp_signed.apk /system/app/ 最后,我需要做一些清理并重新启动手机: su chmod 755 /system/app/ reboot exit exit 如何创建windows批处理文件,以便将这些shell命令

我需要能够在连接到PC的根安卓手机上运行以下命令:

su
mount -o rw,remount /system
chmod 777 /system/app/
exit
exit
然后我需要在我的电脑上执行以下命令:

adb push ..\bin\MyApp_signed.apk /system/app/
最后,我需要做一些清理并重新启动手机:

su
chmod 755 /system/app/
reboot
exit
exit
如何创建windows批处理文件,以便将这些shell命令传递给android shell?

adb shell
允许您从计算机在设备上运行shell命令。如果
su
命令支持
-c
选项,则可以执行以下操作:

adb shell su -c "mount -o rw,remount /system"
adb shell su -c "chmod 777 /system/app/"

adb push ..\bin\MyApp_signed.apk /system/app/

adb shell su -c "chmod 755 /system/app/"
adb shell su -c reboot
如果您的
su
命令不支持命令,您可以在绑定设备端的设备上创建一个脚本。

adb shell
允许您从计算机在设备上运行shell命令。如果
su
命令支持
-c
选项,则可以执行以下操作:

adb shell su -c "mount -o rw,remount /system"
adb shell su -c "chmod 777 /system/app/"

adb push ..\bin\MyApp_signed.apk /system/app/

adb shell su -c "chmod 755 /system/app/"
adb shell su -c reboot
如果您的
su
命令不支持命令,您可以创建一个脚本,将其保留在绑定设备端的设备上