Skip to content

Instantly share code, notes, and snippets.

Joshua Moody jmoody

Block or report user

Report or block jmoody

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jmoody /
Created Sep 1, 2015
carthage bootstrap failing on MacOS AlamoFire
2015-09-01 09:58:00.085 xcodebuild[26704:320561] stream error: stream error at offset 8: unsupported version number ('1.04')

Check dependencies

CompileSwiftSources normal x86_64
    cd /Users/moody/git/biketag/app/Carthage/Checkouts/Alamofire
    /Xcode/6.4/ -target x86_64-apple-macosx10.9 -incremental -module-name Alamofire -O -sdk /Xcode/6.4/
Developer/SDKs/MacOSX10.10.sdk -g -module-cache-path /Users/moody/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -application-extension -I /Users/moody/Library/Developer/Xcode/DerivedData/Alamofir
jmoody /
Created Jun 26, 2015
Calabash iOS: Comprehensive exploration of programmatically changing a UITextField's auto-correct, capitalization, and spell-check settings

Tested on iOS 8 Simulators with all the Keyboard settings "On" (default state).

Partially tested on iOS 7.

  1. You can turn auto-correct on or off.
  2. Changing the capitalization has no effect.
  3. Changing the spell-check settings has no effect.

Any state changes need to be made before the keyboard is presented.

jmoody /
Last active Feb 15, 2018
tmate on macOS

Tmate is a remote tmux session over ssh.

Intall with Homebrew

$ brew update && brew upgrade
$ brew install tmux
$ brew install reattach-to-user-namespace
$ brew install tmate
$ tree -d -L 1
├── Crashlytics.framework
├── Pods
├── build
├── calabash.framework
├── ci-reports
├── config
├── features
jmoody / LPQueryTest.m
Created Feb 25, 2015
testing LPWebQuery
View LPQueryTest.m
- (void) testArrayByEvaluatingQueryCss {
NSString *query = @"a";
LPWebQueryType type = LPWebQueryTypeCSS;
UIWebView *webView = [self webviewWithFrame:[self iphone4sFrame]];
NSString *jsEvaled = @"[{\"rect\":{\"left\":100,\"top\":363.4375,\"width\":24.890625,\"height\":20,\"x\":112,\"y\":373.4375},\"nodeType\":\"ELEMENT_NODE\",\"nodeName\":\"A\",\"id\":\"\",\"class\":\"\",\"href\":\"\",\"textContent\":\"link\"}]";
id mockWebView = [OCMockObject partialMockForObject:webView];
[[[mockWebView expect] andReturn:jsEvaled] stringByEvaluatingJavaScriptFromString:OCMOCK_ANY];
View gist:f631f7af98b93ad58bbe
# The public API is true/false, but we need to pass a path to a dylib to
# run-loop.
- if args.fetch(:inject_dylib, false)
- if simulator_target?(args)
- args[:inject_dylib] = Calabash::Dylibs.path_to_sim_dylib
- else
- args[:inject_dylib] = Cucumber::Dylibs.path_to_device_dylib
+ use_dylib = args.fetch(:inject_dylib, nil)
+ if use_dylib
jmoody / symbolicate
Created Feb 20, 2015
script to call the current Xcode 6's symbolicatecrash binary
View symbolicate
#!/usr/bin/env ruby
# The symbolicatecrash binary that ships with Xcode 6 is hard to find
# and has a bug that requires 'DEVERLOPER_DIR' to be defined.
# Error: "DEVELOPER_DIR" is not defined at \
#<snip>/symbolicatecrash line 60
# Usage:
# $ symbolicatecrash -v \
# -o symbolicated.log \
jmoody /
Last active May 21, 2017
Export a Crash Report From Xcode 6

Xcode 6

  1. Plug in the device and open Xcode
  2. Choose Window -> Devices from the Xcode menu
  3. Under the DEVICES section in the left column, choose the device
  4. To see crash logs, select the View Device Logs button under the Device Information section on the right hand panel
  5. Find your app in the Process column and select the Crash log to see the contents.
  6. IMPORTANT Be sure to symbolicate your crash report.
  7. Export the symbolicated crash report.

The problem is that this kind of UIAlert appears before Instruments can take control of the app.

In some cases, applications that ask for location services, access to contacts, access to photos, etc, immediately after the app is launched are violating the Mobile HIG guidelines.

Quoting the HIG

Ask permission at app startup only if your app can’t perform its primary function without the user’s data. People will not be bothered by this if it’s obvious that the main function of your app depends on knowing their personal information.

Avoid making programmatic calls that trigger the alert before the user actually selects the feature that needs the data.

jmoody /
Created Jan 6, 2015
:host strategy is hanging intermittently on iOS 7 device - run_loop #99

There were ~3000 lines. I trimmed out all the **** lines.

2015-01-05 18:55:53.219 instruments[35602:116064] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-01-05 17:55:56 +0000 Default: OUTPUT_JSON:
{"output":"Starting loop"}
2015-01-05 17:55:56 +0000 Default: ****
2015-01-05 17:55:59 +0000 Default: OUTPUT_JSON:
You can’t perform that action at this time.