Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)

I am trying to run the following commands on the rooted Android phone connected to my PC:

su

mount -o rw,remount /system

chmod 777 /system/app/

exit

exit

Later I tried to execute the following command on my PC:

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

Then finally, I did some cleanup then rebooted my phone:

su

chmod 755 /system/app/

reboot

exit

exit

How do I create the windows batch file so that these shell commands are passed to my android shell?

1 Answer

0 votes
by (36.8k points)

The adb shell <command> allows you to run the shell command on a device from your computer. If the su command supports the -c option, you can do this:

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

If the su command doesn't help commands, you need to make the script to leave on the device that bundles the device side of it.

To know about Linux join the Linux training

Do check out the video below

Related questions

0 votes
1 answer
asked Nov 30, 2020 in Linux by dev_sk2311 (45k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 20, 2020 in Linux by blackindya (18.4k points)

Browse Categories

...