SlideShare a Scribd company logo
1 of 25
Download to read offline
Launch Arguments & 
NSUserDefaults 
Frank Lefebvre 
CocoaHeads Paris 
September 2014
Xcode Schemes 
[0] executable path 
[1] argument1 
[2] argument2 
[3] argument3
Xcode Schemes 
[0] executable path 
[1] argument1 
[2] argument2 
[3] argument3
Xcode Schemes 
[0] executable path 
[1] word1 word2 word3
Obtain launch arguments 
in Cocoa application 
•main
Main: Objective-C 
int main(int argc, char * argv[]) 
{ 
@autoreleasepool { 
for (int i = 0; i < argc; i ++) { 
NSLog(@"%s", argv[i]); 
} 
} 
return 0; 
}
Main: Swift 
// C_ARGC: CInt 
// C_ARGV: UnsafeMutablePointer 
// <UnsafeMutablePointer<Int8>> 
for i in 0..<Int(C_ARGC) { 
let arg = String.fromCString(C_ARGV[i]) 
println((arg)) 
}
Obtain launch arguments 
in Cocoa application 
•main 
• NSProcessInfo
NSProcessInfo 
NSArray* args = 
[NSProcessInfo processInfo].arguments 
let args = 
NSProcessInfo.processInfo().arguments 
// args: [AnyObject]!
Process (Swift) 
// Process.arguments: [String] 
for arg in Process.arguments { 
println((arg)) 
}
Obtain launch arguments 
in Cocoa application 
•main 
• NSProcessInfo 
•NSUserDefaults
NSUserDefaults 
•Arguments: -option value 
id value = [[NSUserDefaults standardDefaults] 
objectForKey:@"option"]; 
• Type conversion 
NSString* value = [[NSUserDefaults 
standardUserDefaults] stringForKey:@"option"]; 
•Complex types
Defaults Domains 
• argument domain 
• application domain 
• global domain 
• language domain 
• registration domain
Usages 
• Override user default 
•Application Configuration 
• Language & Localization Testing 
• Debugging
Application Configuration 
• Production vs Staging vs Development 
• Web Service URL 
• Logging configuration 
• registerDefaults: production settings
Localization 
• -AppleLanguage (en) 
• -AppleLocale fr_FR 
• -NSDoubleLocalizedStrings YES 
• -NSShowNonLocalizedStrings YES 
• -AppleTextDirection YES 
• -NSForceRightToLeftWritingDirection YES
Debugging : Core Data 
• -com.apple.CoreData.SQLDebug 3 
• -com.apple.CoreData.Ubiquity.LogLevel 3 
• -com.apple.CoreData.SyntaxColoredLogging YES 
• -com.apple.CoreData.MigrationDebug
Debugging : Views 
• UIKit 
• -UIViewShowAlignmentRects YES 
•AppKit (Yosemite) 
• -NSResponderDebugResponderLoops YES
Mining for Hidden Gems 
@implementation NSUserDefaults (Spying) 
#pragma GCC diagnostic push 
#pragma GCC diagnostic ignored "-Wobjc-protocol-method-implementation" 
- (NSArray*)arrayForKey:(NSString *)defaultName 
{ 
[self logDefault:defaultName withType:@"array"]; 
return nil; 
} 
// ... 
#pragma GCC diagnostic pop 
@end
Results 
UIDisableLegacyTextView WebKitKerningAndLigaturesEnabledByDefault 
UIKitUsesCoreUIArtwork hasAccessibilityBeenMigrated 
UIPreferredContentSizeCategoryName _UIConstraintBasedLayoutEngageNonLazily 
UIViewShowAlignmentRects NSTypesetterBehavior 
NSTypesetterCompatibilityLevel NSStringDrawingTypesetterBehavior 
NSTextShowsInvisibleCharacters NSTextShowsControlCharacters 
NSTextAllowsNonContiguousLayout NSTextBackgroundLayoutEnabled 
NSTighteningFactorForTruncation NSForceRightToLeftWritingDirection 
NSStringDrawingLongTermCacheSize NSStringDrawingLongTermThreshold 
NSStringDrawingShortTermCacheSize NSPreTigerAttributedStringHash 
_UIConstraintBasedLayout NSConstraintBasedLayoutShouldIntegralize 
_UIConstraintBasedLayoutPlaySoundWhenEngaged 
NSConstraintBasedLayoutDebug 
NSConstraintBasedLayoutDebugEngineConsistency 
NSConstraintBasedLayoutLogPivotCounts 
NSConstraintBasedLayoutDebugIntegralization
UIDisableLegacyTextView WebKitKerningAndLigaturesEnabledByDefault UIKitUsesCoreUIArtwork hasAccessibilityBeenMigrated UIPreferredContentSizeCategoryName 
_UIConstraintBasedLayoutEngageNonLazily UIViewShowAlignmentRects NSTypesetterBehavior NSTypesetterCompatibilityLevel NSStringDrawingTypesetterBehavior 
NSTextShowsInvisibleCharacters NSTextShowsControlCharacters NSTextAllowsNonContiguousLayout NSTextBackgroundLayoutEnabled 
NSTighteningFactorForTruncation NSForceRightToLeftWritingDirection NSStringDrawingLongTermCacheSize NSStringDrawingLongTermThreshold 
NSStringDrawingShortTermCacheSize NSPreTigerAttributedStringHash _UIConstraintBasedLayout CUILogFPOArtwork WebKitSingleTapModeEnabled 
com.apple.uikit.textWebKitJavaEnabled WebKitJavaEnabled com.apple.uikit.textWebKitJavaScriptEnabled WebKitJavaScriptEnabled 
com.apple.uikit.textWebKitPluginsEnabled WebKitPluginsEnabled com.apple.uikit.textWebKitDatabasesEnabledPreferenceKey WebKitDatabasesEnabledPreferenceKey 
com.apple.uikit.textWebKitLocalStorageEnabledPreferenceKey WebKitLocalStorageEnabledPreferenceKey 
com.apple.uikit.textWebKitOfflineWebApplicationCacheEnabled WebKitOfflineWebApplicationCacheEnabled com.apple.uikit.textWebKitDiskImageCacheEnabled 
WebKitDiskImageCacheEnabled com.apple.uikit.textWebKitAcceleratedDrawingEnabled WebKitAcceleratedDrawingEnabled 
com.apple.uikit.textWebKitDefaultFontSize WebKitDefaultFontSize com.apple.uikit.textWebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey 
WebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey com.apple.uikit.textWebKitStandardFont WebKitStandardFont com.apple.uikit.textWebKitMinimumFontSize 
WebKitMinimumFontSize com.apple.uikit.textWebKitShowDebugBorders WebKitShowDebugBorders com.apple.uikit.textWebKitShowRepaintCounter 
WebKitShowRepaintCounter NSHTMLPrefixSpaces NSHTMLInterchangeNewline NSHTMLNoDefaultFonts NSHTMLTabsToSpaces NSHTMLCoalesceTabSpans 
NSHTMLTextEncodingName NSHTMLCharacterEncoding NSUndoManagerDefaultLevelsOfUndo WebKitLocalStorageDatabasePathPreferenceKey WebDatabaseDirectory 
WebKitStoreWebDataForBackup WebKitStorageTrackerEnabledPreferenceKey NSFileManagerRemoveUbiquitousItems WebKitLocalCache 
WebKitDiskImageCacheSavedCacheDirectory WebSmartInsertDeleteEnabled WebKitUseSiteSpecificSpoofing WebKitCursiveFont WebKitDefaultFixedFontSize 
WebKitDefaultTextEncodingName WebKitUsesEncodingDetector WebKitFantasyFont WebKitFixedFont WebKitScreenFontSubstitutionEnabled 
WebKitForceFTPDirectoryListings WebKitFTPDirectoryTemplatePath WebKitWebSecurityEnabled WebKitAllowUniversalAccessFromFileURLs 
WebKitAllowFileAccessFromFileURLs WebKitJavaScriptCanOpenWindowsAutomatically WebKitMinimumLogicalFontSize WebKitPictographFont 
WebKitPrivateBrowsingEnabled WebKitSansSerifFont WebKitSerifFont WebKitDisplayImagesKey WebKitLoadSiteIconsKey WebKitShrinksStandaloneImagesToFit 
WebKitEditableLinkBehavior WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey WebKitDOMPasteAllowedPreferenceKey 
WebKitUsesPageCachePreferenceKey WebKitPageCacheSupportsPluginsPreferenceKey WebKitBackForwardCacheExpirationIntervalKey DisableWebKitDeveloperExtras 
WebKitDeveloperExtras IncludeDebugMenu WebKitDeveloperExtrasEnabledPreferenceKey WebKitJavaScriptExperimentsEnabledPreferenceKey 
WebKitAuthorAndUserStylesEnabledPreferenceKey WebKitApplicationChromeModeEnabledPreferenceKey WebKitStandalonePreferenceKey WebKitMaximumImageSize 
WebKitTelephoneParsingEnabledPreferenceKey WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey WebKitLayoutIntervalPreferenceKey 
WebKitMaxParseDurationPreferenceKey WebKitAlwaysUseAcceleratedOverflowScroll WebKitAllowCompositingLayerVisualDegradation 
WebKitWebArchiveDebugModeEnabledPreferenceKey WebKitLocalFileContentSniffingEnabledPreferenceKey WebKitJavaScriptCanAccessClipboard 
WebKitXSSAuditorEnabled WebKitDNSPrefetchingEnabled WebKitAcceleratedCompositingEnabled WebKitCanvasUsesAcceleratedDrawing 
WebKitAccelerated2dCanvasEnabled WebKitFrameFlatteningEnabled WebKitSpatialNavigationEnabled WebKitPaginateDuringLayoutEnabled WebKitCSSRegionsEnabled 
WebKitCSSCompositingEnabled WebKitWebAudioEnabled WebKitSeamlessIFramesEnabled WebKitCSSGridLayoutEnabled WebKitAsynchronousSpellCheckingEnabled 
WebKitHyperlinkAuditingEnabled WebKitUsePreHTML5ParserQuirks WebKitQTKitEnabled WebKitMediaPlaybackRequiresUserGesture 
WebKitMediaPlaybackAllowsInline WebKitMediaPlaybackAllowsAirPlay WebKitAudioSessionCategoryOverride WebKitNetworkDataUsageTrackingEnabledPreferenceKey 
WebKitNetworkInterfaceNamePreferenceKey WebKitSuppressesIncrementalRendering WebKitRegionBasedColumnsEnabled WebKitBackspaceKeyNavigationEnabled 
WebKitWantsBalancedSetDefersLoadingBehavior WebKitMockScrollbarsEnabled WebKitShouldDisplaySubtitles WebKitShouldDisplayCaptions 
WebKitShouldDisplayTextDescriptions WebKitShouldRespectImageOrientation WebKitRequestAnimationFrameEnabled 
WebKitUseLegacyTextAlignPositionedElementBehavior WebKitDiagnosticLoggingEnabled WebKitLowPowerVideoAudioBufferSizeEnabled WebKitStorageBlockingPolicy 
WebKitPlugInSnapshottingEnabled WebKitHiddenPageCSSAnimationSuspensionEnabled WebKitIncrementalRenderingSuppressionTimeoutInSeconds 
WebKitApplicationCacheDefaultOriginQuota WebKitZoomsTextOnly WebKitMinimumZoomFontSizePreferenceKey WebKitDiskImageCacheMinimumImageSize 
WebKitDiskImageCacheMaximumCacheSize WebKitInterpolationQualityPreferenceKey WebKitEnablePasswordEchoPreferenceKey 
WebKitPasswordEchoDurationPreferenceKey MapsFeatureFreedom DebugDynamicMapModesEnabledKey HideDirectionalArrowsKey UseOldLabelsKey 
AltitudeTelemetryURLKey HighlightUnmatchedRouteLineKey VKReadLandmarksFromDisk VKUseStaticTrafficFeed NSConstraintBasedLayoutShouldIntegralize 
_UIConstraintBasedLayoutPlaySoundWhenEngaged NSConstraintBasedLayoutDebug NSConstraintBasedLayoutDebugEngineConsistency 
NSConstraintBasedLayoutLogPivotCounts NSConstraintBasedLayoutDebugIntegralization _NSRaiseWithRecursiveLayoutRequest _NSAllowsScreenFontKerning 
NSGlyphGeneratorConcreteClassName NSDebugBidi NSCorrectionUnderlineBehavior NSUnderlinesBreakForDescenders PreferCFURLProtocol 
com.apple.uikit.textWebKitCacheModelPreferenceKey WebKitCacheModelPreferenceKey WebKitOmitPDFSupport DataDetectorsUILogLevel 
NSAllowContinuousSpellChecking CUIAllowDebugPrefs CUIRenditionBlockCacheCostLimit NSHTMLIndexing NSTextIndexing NSHTMLTesting NSUseLibXML2 
NSRunWebKitOnAppKitThread __NSDisableSharingTextTabInstance NSRTFWriteOpenStepCompatibleEncodings NSRTFWritePreserveNaturalAlignment 
AppleLanguages
Interesting Options 
• DataDetectorsUILogLevel (integer) 
• NSConstraintBasedLayoutDebug (boolean) 
• NSTextShowsInvisibleCharacters (boolean) 
• NSTextShowsControlCharacters (boolean) 
• WebKitShowDebugBorders (boolean) 
• WebKitShowRepaintCounter (boolean) 
• WebKitDiagnosticLoggingEnabled (boolean)
References 
• http://nshipster.com/launch-arguments-and-environment- 
variables/ 
• http://sssslide.com/speakerdeck.com/ 
kishikawakatsumi/secrets-of-launch-arguments-ios 
• http://oleb.net/blog/2014/02/nsuserdefaults-handling- 
default-values/ 
• Apple Tech Note 2239: iOS Debugging Magic 
•WWDC 2013 session 219
Conclusion 
@franklefebvre dev@franklefebvre.com
Q&A 
@franklefebvre dev@franklefebvre.com

More Related Content

What's hot

遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016Caesar Chi
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxyIvan Serdyuk
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Max Andersen
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaJuan Diego Pereiro Arean
 
What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015jimi-c
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!욱진 양
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesdrupalindia
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleShashikant Jagtap
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Sla Va
 
Dockerize node.js application
Dockerize node.js applicationDockerize node.js application
Dockerize node.js applicationSeokjun Kim
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Jeff Geerling
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflowRiccardo Coppola
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleArnaud LEMAIRE
 
Test Automation using Ruby
Test Automation using Ruby Test Automation using Ruby
Test Automation using Ruby Sla Va
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 

What's hot (20)

遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Cyansible
CyansibleCyansible
Cyansible
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with Ansible
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
 
Firebase slide
Firebase slideFirebase slide
Firebase slide
 
Dockerize node.js application
Dockerize node.js applicationDockerize node.js application
Dockerize node.js application
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
Test Automation using Ruby
Test Automation using Ruby Test Automation using Ruby
Test Automation using Ruby
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 

Similar to Launch Arguments & NSUserDefaults by Franck Lefebvre

Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudgarriguv
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App EngineFred Lin
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration testsKenneth Poon
 
Building a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntBuilding a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntAshley Roach
 
End to End .NET Development on Mac
End to End .NET Development on MacEnd to End .NET Development on Mac
End to End .NET Development on MacMike James
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin PresentationAndrzej Sitek
 
CocoaConf DC - Automate with Swift - Tony Ingraldi
CocoaConf DC -  Automate with Swift - Tony IngraldiCocoaConf DC -  Automate with Swift - Tony Ingraldi
CocoaConf DC - Automate with Swift - Tony IngraldiTony Ingraldi
 
Making Swift Native Modules in React Native
Making Swift Native Modules in React NativeMaking Swift Native Modules in React Native
Making Swift Native Modules in React NativeRay Deck
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureQAware GmbH
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLMario-Leander Reimer
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Netcetera
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
App engine ja night 9 beertalk2
App engine ja night 9 beertalk2App engine ja night 9 beertalk2
App engine ja night 9 beertalk2SATOSHI TAGOMORI
 
Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Gergely Kis
 

Similar to Launch Arguments & NSUserDefaults by Franck Lefebvre (20)

Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloud
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App Engine
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration tests
 
Building a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger HuntBuilding a REST API Microservice for the DevNet API Scavenger Hunt
Building a REST API Microservice for the DevNet API Scavenger Hunt
 
End to End .NET Development on Mac
End to End .NET Development on MacEnd to End .NET Development on Mac
End to End .NET Development on Mac
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
 
CocoaConf DC - Automate with Swift - Tony Ingraldi
CocoaConf DC -  Automate with Swift - Tony IngraldiCocoaConf DC -  Automate with Swift - Tony Ingraldi
CocoaConf DC - Automate with Swift - Tony Ingraldi
 
Making Swift Native Modules in React Native
Making Swift Native Modules in React NativeMaking Swift Native Modules in React Native
Making Swift Native Modules in React Native
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
App engine ja night 9 beertalk2
App engine ja night 9 beertalk2App engine ja night 9 beertalk2
App engine ja night 9 beertalk2
 
Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 

More from CocoaHeads France

More from CocoaHeads France (20)

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer Future
 
iOS App Group for Debugging
iOS App Group for DebuggingiOS App Group for Debugging
iOS App Group for Debugging
 
Asynchronous swift
Asynchronous swiftAsynchronous swift
Asynchronous swift
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeads
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notifications
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec Bitrise
 
Super combinators
Super combinatorsSuper combinators
Super combinators
 
Design like a developer
Design like a developerDesign like a developer
Design like a developer
 
Handle the error
Handle the errorHandle the error
Handle the error
 
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
 
IoT Best practices
 IoT Best practices IoT Best practices
IoT Best practices
 
SwiftyGPIO
SwiftyGPIOSwiftyGPIO
SwiftyGPIO
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérience
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
 
Project Entourage
Project EntourageProject Entourage
Project Entourage
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Launch Arguments & NSUserDefaults by Franck Lefebvre

  • 1. Launch Arguments & NSUserDefaults Frank Lefebvre CocoaHeads Paris September 2014
  • 2. Xcode Schemes [0] executable path [1] argument1 [2] argument2 [3] argument3
  • 3. Xcode Schemes [0] executable path [1] argument1 [2] argument2 [3] argument3
  • 4. Xcode Schemes [0] executable path [1] word1 word2 word3
  • 5. Obtain launch arguments in Cocoa application •main
  • 6. Main: Objective-C int main(int argc, char * argv[]) { @autoreleasepool { for (int i = 0; i < argc; i ++) { NSLog(@"%s", argv[i]); } } return 0; }
  • 7. Main: Swift // C_ARGC: CInt // C_ARGV: UnsafeMutablePointer // <UnsafeMutablePointer<Int8>> for i in 0..<Int(C_ARGC) { let arg = String.fromCString(C_ARGV[i]) println((arg)) }
  • 8. Obtain launch arguments in Cocoa application •main • NSProcessInfo
  • 9. NSProcessInfo NSArray* args = [NSProcessInfo processInfo].arguments let args = NSProcessInfo.processInfo().arguments // args: [AnyObject]!
  • 10. Process (Swift) // Process.arguments: [String] for arg in Process.arguments { println((arg)) }
  • 11. Obtain launch arguments in Cocoa application •main • NSProcessInfo •NSUserDefaults
  • 12. NSUserDefaults •Arguments: -option value id value = [[NSUserDefaults standardDefaults] objectForKey:@"option"]; • Type conversion NSString* value = [[NSUserDefaults standardUserDefaults] stringForKey:@"option"]; •Complex types
  • 13. Defaults Domains • argument domain • application domain • global domain • language domain • registration domain
  • 14. Usages • Override user default •Application Configuration • Language & Localization Testing • Debugging
  • 15. Application Configuration • Production vs Staging vs Development • Web Service URL • Logging configuration • registerDefaults: production settings
  • 16. Localization • -AppleLanguage (en) • -AppleLocale fr_FR • -NSDoubleLocalizedStrings YES • -NSShowNonLocalizedStrings YES • -AppleTextDirection YES • -NSForceRightToLeftWritingDirection YES
  • 17. Debugging : Core Data • -com.apple.CoreData.SQLDebug 3 • -com.apple.CoreData.Ubiquity.LogLevel 3 • -com.apple.CoreData.SyntaxColoredLogging YES • -com.apple.CoreData.MigrationDebug
  • 18. Debugging : Views • UIKit • -UIViewShowAlignmentRects YES •AppKit (Yosemite) • -NSResponderDebugResponderLoops YES
  • 19. Mining for Hidden Gems @implementation NSUserDefaults (Spying) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wobjc-protocol-method-implementation" - (NSArray*)arrayForKey:(NSString *)defaultName { [self logDefault:defaultName withType:@"array"]; return nil; } // ... #pragma GCC diagnostic pop @end
  • 20. Results UIDisableLegacyTextView WebKitKerningAndLigaturesEnabledByDefault UIKitUsesCoreUIArtwork hasAccessibilityBeenMigrated UIPreferredContentSizeCategoryName _UIConstraintBasedLayoutEngageNonLazily UIViewShowAlignmentRects NSTypesetterBehavior NSTypesetterCompatibilityLevel NSStringDrawingTypesetterBehavior NSTextShowsInvisibleCharacters NSTextShowsControlCharacters NSTextAllowsNonContiguousLayout NSTextBackgroundLayoutEnabled NSTighteningFactorForTruncation NSForceRightToLeftWritingDirection NSStringDrawingLongTermCacheSize NSStringDrawingLongTermThreshold NSStringDrawingShortTermCacheSize NSPreTigerAttributedStringHash _UIConstraintBasedLayout NSConstraintBasedLayoutShouldIntegralize _UIConstraintBasedLayoutPlaySoundWhenEngaged NSConstraintBasedLayoutDebug NSConstraintBasedLayoutDebugEngineConsistency NSConstraintBasedLayoutLogPivotCounts NSConstraintBasedLayoutDebugIntegralization
  • 21. UIDisableLegacyTextView WebKitKerningAndLigaturesEnabledByDefault UIKitUsesCoreUIArtwork hasAccessibilityBeenMigrated UIPreferredContentSizeCategoryName _UIConstraintBasedLayoutEngageNonLazily UIViewShowAlignmentRects NSTypesetterBehavior NSTypesetterCompatibilityLevel NSStringDrawingTypesetterBehavior NSTextShowsInvisibleCharacters NSTextShowsControlCharacters NSTextAllowsNonContiguousLayout NSTextBackgroundLayoutEnabled NSTighteningFactorForTruncation NSForceRightToLeftWritingDirection NSStringDrawingLongTermCacheSize NSStringDrawingLongTermThreshold NSStringDrawingShortTermCacheSize NSPreTigerAttributedStringHash _UIConstraintBasedLayout CUILogFPOArtwork WebKitSingleTapModeEnabled com.apple.uikit.textWebKitJavaEnabled WebKitJavaEnabled com.apple.uikit.textWebKitJavaScriptEnabled WebKitJavaScriptEnabled com.apple.uikit.textWebKitPluginsEnabled WebKitPluginsEnabled com.apple.uikit.textWebKitDatabasesEnabledPreferenceKey WebKitDatabasesEnabledPreferenceKey com.apple.uikit.textWebKitLocalStorageEnabledPreferenceKey WebKitLocalStorageEnabledPreferenceKey com.apple.uikit.textWebKitOfflineWebApplicationCacheEnabled WebKitOfflineWebApplicationCacheEnabled com.apple.uikit.textWebKitDiskImageCacheEnabled WebKitDiskImageCacheEnabled com.apple.uikit.textWebKitAcceleratedDrawingEnabled WebKitAcceleratedDrawingEnabled com.apple.uikit.textWebKitDefaultFontSize WebKitDefaultFontSize com.apple.uikit.textWebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey WebKitAlwaysUseBaselineOfPrimaryFontPreferenceKey com.apple.uikit.textWebKitStandardFont WebKitStandardFont com.apple.uikit.textWebKitMinimumFontSize WebKitMinimumFontSize com.apple.uikit.textWebKitShowDebugBorders WebKitShowDebugBorders com.apple.uikit.textWebKitShowRepaintCounter WebKitShowRepaintCounter NSHTMLPrefixSpaces NSHTMLInterchangeNewline NSHTMLNoDefaultFonts NSHTMLTabsToSpaces NSHTMLCoalesceTabSpans NSHTMLTextEncodingName NSHTMLCharacterEncoding NSUndoManagerDefaultLevelsOfUndo WebKitLocalStorageDatabasePathPreferenceKey WebDatabaseDirectory WebKitStoreWebDataForBackup WebKitStorageTrackerEnabledPreferenceKey NSFileManagerRemoveUbiquitousItems WebKitLocalCache WebKitDiskImageCacheSavedCacheDirectory WebSmartInsertDeleteEnabled WebKitUseSiteSpecificSpoofing WebKitCursiveFont WebKitDefaultFixedFontSize WebKitDefaultTextEncodingName WebKitUsesEncodingDetector WebKitFantasyFont WebKitFixedFont WebKitScreenFontSubstitutionEnabled WebKitForceFTPDirectoryListings WebKitFTPDirectoryTemplatePath WebKitWebSecurityEnabled WebKitAllowUniversalAccessFromFileURLs WebKitAllowFileAccessFromFileURLs WebKitJavaScriptCanOpenWindowsAutomatically WebKitMinimumLogicalFontSize WebKitPictographFont WebKitPrivateBrowsingEnabled WebKitSansSerifFont WebKitSerifFont WebKitDisplayImagesKey WebKitLoadSiteIconsKey WebKitShrinksStandaloneImagesToFit WebKitEditableLinkBehavior WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey WebKitDOMPasteAllowedPreferenceKey WebKitUsesPageCachePreferenceKey WebKitPageCacheSupportsPluginsPreferenceKey WebKitBackForwardCacheExpirationIntervalKey DisableWebKitDeveloperExtras WebKitDeveloperExtras IncludeDebugMenu WebKitDeveloperExtrasEnabledPreferenceKey WebKitJavaScriptExperimentsEnabledPreferenceKey WebKitAuthorAndUserStylesEnabledPreferenceKey WebKitApplicationChromeModeEnabledPreferenceKey WebKitStandalonePreferenceKey WebKitMaximumImageSize WebKitTelephoneParsingEnabledPreferenceKey WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey WebKitLayoutIntervalPreferenceKey WebKitMaxParseDurationPreferenceKey WebKitAlwaysUseAcceleratedOverflowScroll WebKitAllowCompositingLayerVisualDegradation WebKitWebArchiveDebugModeEnabledPreferenceKey WebKitLocalFileContentSniffingEnabledPreferenceKey WebKitJavaScriptCanAccessClipboard WebKitXSSAuditorEnabled WebKitDNSPrefetchingEnabled WebKitAcceleratedCompositingEnabled WebKitCanvasUsesAcceleratedDrawing WebKitAccelerated2dCanvasEnabled WebKitFrameFlatteningEnabled WebKitSpatialNavigationEnabled WebKitPaginateDuringLayoutEnabled WebKitCSSRegionsEnabled WebKitCSSCompositingEnabled WebKitWebAudioEnabled WebKitSeamlessIFramesEnabled WebKitCSSGridLayoutEnabled WebKitAsynchronousSpellCheckingEnabled WebKitHyperlinkAuditingEnabled WebKitUsePreHTML5ParserQuirks WebKitQTKitEnabled WebKitMediaPlaybackRequiresUserGesture WebKitMediaPlaybackAllowsInline WebKitMediaPlaybackAllowsAirPlay WebKitAudioSessionCategoryOverride WebKitNetworkDataUsageTrackingEnabledPreferenceKey WebKitNetworkInterfaceNamePreferenceKey WebKitSuppressesIncrementalRendering WebKitRegionBasedColumnsEnabled WebKitBackspaceKeyNavigationEnabled WebKitWantsBalancedSetDefersLoadingBehavior WebKitMockScrollbarsEnabled WebKitShouldDisplaySubtitles WebKitShouldDisplayCaptions WebKitShouldDisplayTextDescriptions WebKitShouldRespectImageOrientation WebKitRequestAnimationFrameEnabled WebKitUseLegacyTextAlignPositionedElementBehavior WebKitDiagnosticLoggingEnabled WebKitLowPowerVideoAudioBufferSizeEnabled WebKitStorageBlockingPolicy WebKitPlugInSnapshottingEnabled WebKitHiddenPageCSSAnimationSuspensionEnabled WebKitIncrementalRenderingSuppressionTimeoutInSeconds WebKitApplicationCacheDefaultOriginQuota WebKitZoomsTextOnly WebKitMinimumZoomFontSizePreferenceKey WebKitDiskImageCacheMinimumImageSize WebKitDiskImageCacheMaximumCacheSize WebKitInterpolationQualityPreferenceKey WebKitEnablePasswordEchoPreferenceKey WebKitPasswordEchoDurationPreferenceKey MapsFeatureFreedom DebugDynamicMapModesEnabledKey HideDirectionalArrowsKey UseOldLabelsKey AltitudeTelemetryURLKey HighlightUnmatchedRouteLineKey VKReadLandmarksFromDisk VKUseStaticTrafficFeed NSConstraintBasedLayoutShouldIntegralize _UIConstraintBasedLayoutPlaySoundWhenEngaged NSConstraintBasedLayoutDebug NSConstraintBasedLayoutDebugEngineConsistency NSConstraintBasedLayoutLogPivotCounts NSConstraintBasedLayoutDebugIntegralization _NSRaiseWithRecursiveLayoutRequest _NSAllowsScreenFontKerning NSGlyphGeneratorConcreteClassName NSDebugBidi NSCorrectionUnderlineBehavior NSUnderlinesBreakForDescenders PreferCFURLProtocol com.apple.uikit.textWebKitCacheModelPreferenceKey WebKitCacheModelPreferenceKey WebKitOmitPDFSupport DataDetectorsUILogLevel NSAllowContinuousSpellChecking CUIAllowDebugPrefs CUIRenditionBlockCacheCostLimit NSHTMLIndexing NSTextIndexing NSHTMLTesting NSUseLibXML2 NSRunWebKitOnAppKitThread __NSDisableSharingTextTabInstance NSRTFWriteOpenStepCompatibleEncodings NSRTFWritePreserveNaturalAlignment AppleLanguages
  • 22. Interesting Options • DataDetectorsUILogLevel (integer) • NSConstraintBasedLayoutDebug (boolean) • NSTextShowsInvisibleCharacters (boolean) • NSTextShowsControlCharacters (boolean) • WebKitShowDebugBorders (boolean) • WebKitShowRepaintCounter (boolean) • WebKitDiagnosticLoggingEnabled (boolean)
  • 23. References • http://nshipster.com/launch-arguments-and-environment- variables/ • http://sssslide.com/speakerdeck.com/ kishikawakatsumi/secrets-of-launch-arguments-ios • http://oleb.net/blog/2014/02/nsuserdefaults-handling- default-values/ • Apple Tech Note 2239: iOS Debugging Magic •WWDC 2013 session 219