fastlane-old / snapshot

Automate taking localized screenshots of your iOS app on every device
https://fastlane.tools
1.96k stars 141 forks source link

Patch simulator to set a Dynamic Type #446

Closed gabek closed 8 years ago

gabek commented 8 years ago

Feature request

I'd love if we could automate screenshots that set the Dynamic Type size for a session in order to verify Text Styles on different size screens, much like we can set the language for a session.

I'm not sure if this is even possible, or what settings are patchable in the simulator, but it'd be quite useful!

vpolouchkine commented 8 years ago

Great idea! I will share this with the team and see what we can do in a future release. I’ll reopen this ticket and keep you updated when we get a chance to revisit this, stay tuned :+1: If you want to tackle this yourself, check out the countdown repo to learn how to contribute to fastlane.

gabek commented 8 years ago

Awesome. I'll leave some notes for either me, or whoever runs into this to look into it in the future.

Dynamic Text's setting is set in the com.apple.UIKit.plist file located in the Simulator's data/Library/Preferences directory. ~/Library/Developer/CoreSimulator/Devices/30222730-2044-42FA-9E25-AB4C59880068/data/Library/Preferences/com.apple.UIKit.plist, for example.

It has a key of UIPreferredContentSizeCategoryName that can be set to the following:

--And the crazy large--

This can be set via the command line with plutil: plutil -replace "UIPreferredContentSizeCategoryName" -string UICTContentSizeCategoryL com.apple.UIKit.plist

The simulator needs to be restarted after setting this value in order for it to take effect.

So since Snapshot is running the simulator via its device udid anyway, it would know the location to this plist file. It seems logical that this key could be altered before this step.

fastlanebot commented 8 years ago

This issue was migrated to https://github.com/fastlane/fastlane/issues/2490. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket: