xcode - Swift: How to reset simulator by running shell command -


i trying reset simulator after every test. found best way it, execute

xcrun simctl erase 

but don't know how add shell command in swift file execute it.

i tried

import foundation func shell(_ args: string...) -> int32 {     let task = process()     task.launchpath = "/usr/bin/env"     task.arguments = args     task.launch()     task.waituntilexit()     return task.terminationstatus   } 

but got error, process u\identifier not found please help. trying reset simulators after each test.

can uninstall particular application simulator command line? or other way between each test, in teardown()

i had similar issue , able resolve sbtuitesttunnel. chose use framework had had communicate between testing application , actual application configure testing states.

with sbtuitesttunnel implemented can specify launch options, 1 require sbtuitunneledapplicationlaunchoptionresetfilesystem.

app.launchtunnel(withoptions: [sbtuitunneledapplicationlaunchoptionresetfilesystem]) {  // additional setup before app launches  // i.e. prepare stub request, start monitoring requests  } 

i recommend having @ sbtuitesttunnel allow other powerful things.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -