diff --git a/commands/FBPrintCommands.py b/commands/FBPrintCommands.py index 68ec104..914b68c 100644 --- a/commands/FBPrintCommands.py +++ b/commands/FBPrintCommands.py @@ -31,6 +31,7 @@ def lldbcommands(): FBPrintInstanceVariable(), FBPrintKeyPath(), FBPrintApplicationDocumentsPath(), + FBPrintApplicationBundlePath(), FBPrintData(), FBPrintTargetActions(), FBPrintJSON(), @@ -345,6 +346,28 @@ def run(self, arguments, options): os.system('open '+ pathString) +class FBPrintApplicationBundlePath(fb.FBCommand): + def name(self): + return 'pbundlepath' + + def description(self): + return "Print application's bundle directory path." + + def options(self): + return [ + fb.FBCommandArgument(short='-o', long='--open', arg='open', boolean=True, default=False, help='open in Finder'), + ] + + def run(self, arguments, options): + path = fb.evaluateExpressionValue('(NSString*)[[NSBundle mainBundle] bundlePath]') + pathString = '{}'.format(path).split('"')[1] + cmd = 'echo {} | tr -d "\n" | pbcopy'.format(pathString) + os.system(cmd) + print pathString + if options.open: + os.system('open '+ pathString) + + class FBPrintData(fb.FBCommand): def name(self): return 'pdata'