Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix close simulator and add reset simulator #74

Open
ehuebner opened this issue Nov 16, 2014 · 1 comment
Open

Fix close simulator and add reset simulator #74

ehuebner opened this issue Nov 16, 2014 · 1 comment

Comments

@ehuebner
Copy link

I worked with that amazing script and recognized two things:

The close sim function does not work:
Simulator application name is "iOS Simulator", not "iPhone Simulator"
function _close_sim {

I know, I know. It says "iPhone Simulator". For some reason,

that's the only way Applescript can identify it.

osascript -e "tell application "iOS Simulator" to quit"
}

I had to delete the app from the simulator to get the new code version in UIAutomation so i reset all simulators before the "_xcode clean build" call by calling my "_reset_all_sim" function:
function _reset_all_sim {
instruments -s devices
| grep Simulator
| grep -o "[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}"
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
}

Attention: If a simulator is running it will not be cleaned. I recommend to call "_close_sim" before "_reset_all_sim" to ensure all simulators are getting cleared.

@jonathanpenn
Copy link
Owner

I've you'd like to submit a pull request, I'll merge this in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants