2
votes

I want to generate the code coverage files for our iOS App.

The problem is that when I build the code with the test coverage settings it builds and then the Simulator launches the App. Now I want to run my UIAutomation functional tests, but as soon as I kick off my tests using the instruments command, the Simulator restarts!

For code coverage files to be generated, the App must not restart.

Has anybody found a way yet to use the already running simulator to execute the UIAutomation tests?

1
As far as I know, the UI Automation instrument needs to attach at app launch, probably has something to do with the way the private automation framework is linked in at runtime by Instruments. What code coverage tool are you using? Why are you unable to have it track coverage while UI Automation is running? - Jonathan Penn
Hi Jonathan, I am using the following command to start my UIAutomation tests: instruments -t $TemplateLocation $AppLocation -e UIASCRIPT $ScriptFileLocation -e UIARESULTSPATH $ResultPath This command is re-starting the simulator/App and then it runs the tests. The problem is to generate the code coverage files, the App should not re-start till all the tests have run. As mentioned earlier, when I run the build in Xcode it starts the simulator and runs the App, now I want to somehow attach my tests to this already running simulator. I am using Coverstory to get the code coverage results. - Anand

1 Answers

0
votes

You may be able to find some ideas from this previous question

Is there any way to test the code coverage of UIAutomation tests?