Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View depth42's full-sized avatar

Frank Illenberger depth42

  • ProjectWizards
  • Frankfurt, Germany
View GitHub Profile
//
// PWFilePromise.h
// PWAppKit
//
// Created by Frank Illenberger on 09.01.18.
// Copyright © 2018 ProjectWizards. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
@depth42
depth42 / gist:e0da81f3a7b4e249c102ad1e832033af
Created July 8, 2016 06:17
How to manually symbolicate crash logs from dSYMs in Terminal.app
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash [path to crashlog file] [paths to dSYMs]
@depth42
depth42 / gist:291d9cc9ffde5bf8652b
Created December 7, 2015 16:32
How to force a Spotlight importer embedded in an app to be recognized by the system for testing
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /path/to/MyApp.app
@depth42
depth42 / gist:3cca45bea960f073269b
Created October 22, 2015 11:54
Configuring SMPT relay for Xcode server
sudo xcrun xcscontrol --configure-email-transport 127.0.0.1
@depth42
depth42 / gist:fbe19ed2ac953753e744
Created July 2, 2015 10:31
How to prevent Xcode from automatically restoring the last open project. This enables running multiple Xcode versions for different projects.
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState YES
@depth42
depth42 / MEUnarchiver.h
Last active August 29, 2015 14:17
Attempt at implementing a replacement for NSUnarchiver which is not available under iOS. This can be handy for reading legacy file-formats on iOS devices. It does not provide all features of NSUnarchiver but the basic stuff is there. Has been moved to https://github.com/depth42/MEUnarchiver
Has been moved to https://github.com/depth42/MEUnarchiver
@depth42
depth42 / Example for not breaking on certain exceptions
Last active August 9, 2016 14:14
Breaking on exceptions in Objective-C is cumbersome, because a breakpoint on objc_exception_throw cannot differentiate between an expected (caught) exception and an unexpected exception (like one from a failed assertion). To work around this, we intercept objc_exception_throw using mach_override and apply filter rules to decide whether to break …
@implementation NSManagedObjectContext (PWExtensions)
#ifndef NDEBUG
// Core Data uses exceptions to notify itself about optimistic locking failures. These exceptions are intercepted by
// Core Data and never reach the client code. Such an exception should not drop in the debugger because it is not raised
// due to a programming error.
// Since the exception is thrown inside -[NSManagedObjectContext save:], this category is a logical place to install
// the filter.
+ (void) load
{
@depth42
depth42 / gist:7419292
Created November 11, 2013 19:54
My former Jenkins build script for performing xcode tests using xctool
rm -f ${WORKSPACE}/test-report.xml
rm -rf /Users/jenkins/Library/Developer/Xcode/DerivedData
rm -rf ${WORKSPACE}/Build/Products
nice -n 20 /Users/jenkins/xctool/xctool -reporter pretty -reporter junit:${WORKSPACE}/test-report.xml -workspace MyWorkspace.xcworkspace -scheme MyScheme -configuration Debug SYMROOT=${WORKSPACE}/Build/Products test OTHER_CFLAGS='$(inherited) -Qunused-arguments -Werror'
# Note the -Qunused-arguments is needed because xcodebuild adds unused compiler arguments about which clang complains a lot. Together with -Werror this results in failed builds. So we have to silence this kind of warning.
@depth42
depth42 / gist:7419263
Created November 11, 2013 19:51
My former Jenkins build script for performing xcode tests using xcodebuild and ocunit2junit
rm -f ${WORKSPACE}/test-reports/*.xml
rm -rf /Users/jenkins/Library/Developer/Xcode/DerivedData
rm -rf ${WORKSPACE}/Build/Products
nice -n 20 xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -configuration Debug SYMROOT=${WORKSPACE}/Build/Products clean test OTHER_CFLAGS='$(inherited) -Qunused-arguments -Werror' | ocunit2junit
@depth42
depth42 / gist:7356279
Created November 7, 2013 15:16
Workaround for XCTest not reporting failing NSAssertions.
#import "PWAssertionHandler.h"
#import "PWLog.h"
#import "Intercept_objc_exception_throw.h"
#import <objc/runtime.h>
#import "PWDispatch.h"
#ifndef NDEBUG
@interface NSAssertionHandler (PWExtensions)
@property (nonatomic, readonly) BOOL isPWHandler;