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!
Q: How does iOS determine the language for my app? A: To determine the language for your app, iOS considers not only the order of the user language preferences (in General > Language & Region of the Settings application) but also the localizations your app declares it supports.
Swift is a great programming language to automate small tasks in your daily workflow on macOS. Raycast puts these scripts at your fingertips and you execute them from anywhere on your desktop. You can take it one step further, and assign a global hotkey to your script command.
There Are Two Main Languages That Power iOS: Objective-C and Swift. You can use other languages to code iOS apps, but they may require significant workarounds that require more effort than needed.
UI Automation is a tool that Apple provides and maintains for higher level, automated, testing of iOS applications. Tests are written in JavaScript, adhering to an API defined by Apple. Writing tests can be made easier by relying on accessibility labels for user interface elements in your application.
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.
There is another github project called Snapshot, for exactly what you want.
It provides the same (and more) features that UI Screen Shooter has, and I found it to be a bit more fleshed out and documented.
The most challenging part of getting up and running is learning the Javascript API for performing actions in the simulator, but you can find many useful tutorials for that online.
Here are some useful references:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With