Merge pull request #1032 from iansf/fix_ios_logs

Guard IOSDevice logs
This commit is contained in:
Ian Fischer 2015-09-02 21:34:39 -07:00
commit 8df083df39

View File

@ -604,6 +604,17 @@ class IOSDevice(object):
@classmethod @classmethod
def logs(cls): def logs(cls):
try:
cmd = [
'which',
'idevicesyslog'
]
logging.info(' '.join(cmd))
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
logging.error('"log" command only works with iOS devices if you have installed idevicesyslog. Run "brew install libimobiledevice" to install it with homebrew.')
return None
def do_logs(): def do_logs():
cmd = [ cmd = [
'idevicesyslog', 'idevicesyslog',