deounix deounix - 4 days ago 6
Python Question

Enter adb shell from python

I'm trying to execute command to adb shell from python
I'm using Windows OS

On CMD :

C:\Users\deounix>adb shell
shell@android:/ $ su root
su root
root@android:/ # reboot


What I'm doing is :

import os

os.popen("adb shell & su root & reboot")


But it isn't work

How can I do it?

Answer
import os
os.system("adb shell su -c reboot")
Comments