Search code examples
iosxcodeautomationinstrumentsios-ui-automation

iOS UI Automation for different languages


my iOS application has localization for 10+ languages. I'd like to check that all screens looks ok (labels aren't too long/short etc).

I know I can go through my app and make screenshots using UI Automation. Is there any way do switch simulator's language in UI Automation? Is there any way to generate screenshots for my app just by launching 1 command?

Thanks!


Solution

  • Yes there is. I just wrote it myself as a matter of fact. :)

    Use this project: https://github.com/jonathanpenn/ui-screen-shooter

    It's a demonstration of how to run UI Automation from the command line, swap simulator languages with a plist changing command, and choose simulator device types with an AppleScript. It's documented heavily with comments, but if you're confused about something, feel free to open an issue or a pull request on the project and we can improve it.