Skip to content

Instantly share code, notes, and snippets.

View jmoody's full-sized avatar

Joshua Moody jmoody

  • Germany
View GitHub Profile
@jmoody
jmoody / crash.md
Created September 8, 2015 10:45
Xcode 7 beta 6 crashes when trying to launch an app that is not installed on iOS Simulator
Process:               instruments [28786]
Path:                  /Xcode/*/Xcode-beta.app/Contents/Developer/usr/bin/instruments
Identifier:            instruments
Version:               $[MARKETING_VERSION] (58156.1)
Code Type:             X86-64 (Native)
Parent Process:        ruby [28667]
Responsible:           Terminal [340]
User ID:               502
@jmoody
jmoody / trace.md
Created September 1, 2015 08:11
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')
=== BUILD TARGET Alamofire OSX OF PROJECT Alamofire WITH CONFIGURATION Release ===

Check dependencies

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /Users/moody/git/biketag/app/Carthage/Checkouts/Alamofire
    /Xcode/6.4/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -target x86_64-apple-macosx10.9 -incremental -module-name Alamofire -O -sdk /Xcode/6.4/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/
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
jmoody / README.md
Created June 26, 2015 11:21
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
jmoody / tmate-on-macOS.md
Last active February 25, 2024 00:50
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
jmoody / LPQueryTest.m
Created February 25, 2015 00:06
testing LPWebQuery
- (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\":\"http://www.googl.com/\",\"textContent\":\"link\"}]";
id mockWebView = [OCMockObject partialMockForObject:webView];
[[[mockWebView expect] andReturn:jsEvaled] stringByEvaluatingJavaScriptFromString:OCMOCK_ANY];
```
# 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
jmoody / symbolicate
Created February 20, 2015 10:20
script to call the current Xcode 6's symbolicatecrash binary
#!/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 \
# Xcode.app/Contents/SharedFrameworks/<snip>/symbolicatecrash line 60
# Usage:
# $ symbolicatecrash -v \
# -o symbolicated.log \
@jmoody
jmoody / export-crash-report.md
Last active May 21, 2017 08:57
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.