Skip to content

Instantly share code, notes, and snippets.

@ohnit
ohnit / bumpBuildTo
Last active May 15, 2020 20:50
Change Xcode Build and Version numbers for all targets
#! /bin/bash
# See "To Use" instructions at at bottom of file
bumpBuildForSchemeTo() {
local scheme=$1
local buildNumber=$2
filePath=$(xcodebuild -workspace "$workspace" -scheme "$scheme" -configuration Debug -showBuildSettings | grep "^\s*INFOPLIST_FILE" | awk '{print $3}')
@ohnit
ohnit / Print a class's methods
Last active December 11, 2019 17:26
LLDB Scripts
# print out names of a class's methods by using the class's name.
# change the name of the class on the first line. Copy, paste, and press enter
po NSString *$className = @"UIView";
po id $myClass = objc_getClass((const char *)[$className cStringUsingEncoding:4]); unsigned int $outCount; Method *$methods = (Method *)class_copyMethodList ($myClass, &$outCount); NSMutableArray *$array = [[NSMutableArray alloc] init];
po for(NSUInteger $i = 0; $i < $outCount; $i++) { Method $method = $methods[$i];NSString *$methodName = [NSString stringWithCString:(char *)sel_getName((SEL)method_getName($method))];[$array addObject:$methodName]; }
po $array