Created
March 27, 2014 14:03
-
-
Save JaniJegoroff/d7f7887c88666e9f683d to your computer and use it in GitHub Desktop.
Xcode 5.1 / Simulator 7.1: Enable accessibility workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before do |scenario| | |
enable_accessibility | |
@calabash_launcher = Calabash::Cucumber::Launcher.new | |
unless @calabash_launcher.calabash_no_launch? | |
@calabash_launcher.relaunch | |
@calabash_launcher.calabash_notify(self) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SIMULATOR = ENV['DEVICE_TARGET'].downcase.include?('simulator') | |
def enable_accessibility | |
# Enable accessibility and dismiss 'Accessibility Inspector' window | |
return unless SIMULATOR | |
accessibilityPlistPath = '~/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Preferences/com.apple.Accessibility.plist' | |
`killall 'iPhone Simulator'` | |
`rm -rf ~/Library/Application\ Support/iPhone\ Simulator/` | |
`defaults write #{accessibilityPlistPath} "AXInspectorEnabled" '1'` | |
`defaults write #{accessibilityPlistPath} "AXInspector.enabled" '0'` | |
`defaults write #{accessibilityPlistPath} "AccessibilityEnabled" '1'` | |
`osascript -e 'tell application "iPhone Simulator" to activate'` | |
sleep 5 | |
`defaults write #{accessibilityPlistPath} "AXInspectorEnabled" '0'` | |
`killall 'iPhone Simulator'` | |
end | |
enable_accessibility |
Hi gsaslis, thanks for the comment!
Similar workaround should be now integrated to calabash-ios version 0.9.169 so custom workaround should not be needed anymore. See https://groups.google.com/forum/#!topic/calabash-ios/aiMN5NEZM5I
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there & thanks for this!
I did have a bit of trouble using it, until I changed the last defaults line to
defaults write #{accessibilityPlistPath} "AXInspectorEnabled" '1'
(i.e. 1 instead of 0)