Around 5 months ago, Google has opensourced ios-device-control to make iOS related work automate. The repository supports both real devices and simulators.
https://github.com/google/ios-device-control
It provides some examples and [https://github.com/google/ios-device-control/blob/master/java/com/google/iosdevicecontrol/examples/ExampleSimulatorDeviceControl.java] is one example with Simulator. When we run the example, we can see the following outputs.
$ java -jar SimulatorDevice-jar-with-dependencies.jar Jan 15, 2018 12:15:03 AM com.google.iosdevicecontrol.examples.ExampleSimulatorDeviceControl main INFO: Screenshot written to: /var/folders/y6/524wp8fx0xj5q1rf6fktjrb00000gn/T/screenshot4392370072269065541.png
Google has EarlGrey for test automation against UI level and this repository doesn’t compete with it since this tool looks mainly for handle real devices, I guess. I know every one who hope to enhance test automation for iOS struggling with the difficulties.
Have a good automation 🙂