Hi xda!
I have a python script that I got working on my android phone. Its working perfectly, exept i have a adb shell script, that needs to be run with the python script. I usually do this by hooking my phone to the laptop, but to make it smarter, I'll be run entirely on my phone.
My phone is a Samsung Galaxy S I9000 and its rooted
The execute command in the python script:
def change_IP():
os.system(r'""C:\Tools\adb\changeip.bat""')
class Eonda(object):
def change_IP():
os.system(r'""C:\Tools\adb\changeip.bat""')
return
What it does that it changes ip by disabling the 3G data and enables it again. The following bat script is here:
@ECHO off
set PATH="C:\Scripts\android-sdk-windows\platform-tools"
@ECHO on
@ECHO Changing IP Adress
@ECHO off
adb shell "su -c 'svc data disable'"
adb shell "su -c 'sleep 5'"
adb shell "su -c 'svc data enable'"
adb shell "su -c 'sleep 5'"
So my question that I need a way to execute the terminal commands, by either some sort of scriptway, like the .bat file if its possible. Thats the easiest way as I just need the new Changing IP script with the terminal commands :)
I hope you can help me or direct me in the right way :)
Thanks in advance
I have a python script that I got working on my android phone. Its working perfectly, exept i have a adb shell script, that needs to be run with the python script. I usually do this by hooking my phone to the laptop, but to make it smarter, I'll be run entirely on my phone.
My phone is a Samsung Galaxy S I9000 and its rooted
The execute command in the python script:
def change_IP():
os.system(r'""C:\Tools\adb\changeip.bat""')
class Eonda(object):
def change_IP():
os.system(r'""C:\Tools\adb\changeip.bat""')
return
What it does that it changes ip by disabling the 3G data and enables it again. The following bat script is here:
@ECHO off
set PATH="C:\Scripts\android-sdk-windows\platform-tools"
@ECHO on
@ECHO Changing IP Adress
@ECHO off
adb shell "su -c 'svc data disable'"
adb shell "su -c 'sleep 5'"
adb shell "su -c 'svc data enable'"
adb shell "su -c 'sleep 5'"
So my question that I need a way to execute the terminal commands, by either some sort of scriptway, like the .bat file if its possible. Thats the easiest way as I just need the new Changing IP script with the terminal commands :)
I hope you can help me or direct me in the right way :)
Thanks in advance
0 commentaires:
Remarque : Seul un membre de ce blog est autorisé à enregistrer un commentaire.