I am writing to file as below
subprocess.Popen(['adb', 'logcat', '>', 'log.txt'])
But rather than writing to file it writes to console. I guess it is reading first 2 commands only?
I am writing to file as below
subprocess.Popen(['adb', 'logcat', '>', 'log.txt'])
But rather than writing to file it writes to console. I guess it is reading first 2 commands only?
I don't believe that redirection with '>' works with subprocess. However, you can define where output goes by specifying it in 'stderr' like so:
f = open('log.txt', 'w')
p = subprocess.Popen(['abd', 'logcat'], stdout=f)
Hope this helps.