Revision control

1
import logging
2
import subprocess
3
4
logging.getLogger(__name__).addHandler(logging.NullHandler())
5
6
7
class XCRun(object):
8
binary = 'xcrun'
9
logger = logging.getLogger()
10
11
def _run(self, *args):
12
args = [self.binary, 'simctl'] + list(args)
13
self.logger.info('Running: {}'.format(' '.join(args)))
14
subprocess.check_call(args)
15
16
def shutdown(self, device='all'):
17
self._run('shutdown', device)
18
19
def erase(self, device='all'):
20
self.shutdown(device)
21
self._run('erase', device)