Guard sky_tool logs against failures due to missing idevicesyslog

This commit is contained in:
Ian Fischer
2015-09-02 17:08:32 -07:00
parent 3b6c6611d8
commit 1800c88967

View File

@@ -604,6 +604,17 @@ class IOSDevice(object):
@classmethod
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():
cmd = [
'idevicesyslog',