Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions commands/FBPrintCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def lldbcommands():
FBPrintInstanceVariable(),
FBPrintKeyPath(),
FBPrintApplicationDocumentsPath(),
FBPrintApplicationBundlePath(),
FBPrintData(),
FBPrintTargetActions(),
FBPrintJSON(),
Expand Down Expand Up @@ -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'
Expand Down