turn off wifi from device while xcode ui test execution is going on
<p>I am facing a problem in xcode ui test. </p>

<p>That is, while my execution is going on, than in certain condition </p>

<pre><code>i have to off my wifi
</code></pre>

<p>I know that i can use the command to do it</p>

<pre><code>networksetup -setairportpower en0 on
</code></pre>

<p>I have written a function in osx:</p>

<pre><code>func runTerminalCommand(args: String...) -&gt; Int32 {
let task = NSTask()
task.launchPath = "/usr/bin/env"
task.arguments = args
task.launch()
task.waitUntilExit()
return task.terminationStatus
</code></pre>

<p>}</p>

<p>If i use this in osx, i can turn off wifi. </p>

<p>But i can not use this in my ios app or can not use this in my 
xcode ui test.</p>

<p>How i can off my wifi while xcode ui testing is ongoing ?</p>