android - OSError: [Errno 2] No such file or directory when running systrace.py -
i'm trying run systrace python script included in platform-tools folder , i'm getting following error:
file "systrace.py", line 274, in <module> main() file "systrace.py", line 60, in main device_sdk_version = get_device_sdk_version() file "systrace.py", line 44, in get_device_sdk_version stderr=subprocess.pipe) file "/usr/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) file "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child raise child_exception oserror: [errno 2] no such file or directory
i'm running on ubuntu 12.04 lts. here command i'm using run systrace:
sudo python systrace.py -o output.html
note: sudo in order avoid following error:
file "systrace.py", line 274, in <module> main() file "systrace.py", line 63, in main os.execv(legacy_script, sys.argv) oserror: [errno 13] permission denied
after doing searching around web found 1 solution add adb path variable. added platform-tools directory path , i'm still getting same error. went ahead check code causing problem , apparently snippet:
adb = subprocess.popen(getprop_args, stdout=subprocess.pipe, stderr=subprocess.pipe)
where getprop_args
defined follows:
getprop_args = ['adb', 'shell', 'getprop', 'ro.build.version.sdk']
from understand code trying run following command:
adb shell getprop ro.build.version.sdk
i ran command in console , work no problem. copied both lines of code , ran them in python interpreter , ran without problem. don't know how solve issue. know of possible solution?
ok found out problem was. problem sudo
putting right before python systrace.py -o output.html
didn't know guess path
variable different when using sudo
, when not using it. path
in sudo
didn't have platform-tools directory. removed sudo , getting following error:
file "systrace.py", line 274, in <module> main() file "systrace.py", line 63, in main os.execv(legacy_script, sys.argv) oserror: [errno 13] permission denied
to solve problem ran following command on legacy_script:
$chmod +x ./systrace-legacy.py
and able run systrace script without problem :p
Comments
Post a Comment