Trying to find a solution to automate task-kill the app for XCUITest...
static let springboard:XCUIApplication? = XCUIApplication(bundleIdentifier: "com.apple.springboard")
class func killApp(app:XCUIApplication) -> Bool
{
app.terminate()
if let springboard = springboard
{
springboard.activate()
XCUIDevice.shared.press(.home)
XCUIDevice.shared.press(.home)
Thread.sleep(forTimeInterval: 1.0)
let appTask = app.otherElements["appID"]
if appTask.isHittable
{
appTask.swipeUp()
XCUIDevice.shared.press(.home)
return true
}
else
{
print("App task is not hittable!")
return false
}
}
return false
}
But it's not working. The two home button taps seem not to be recognized as a quick double-tap. Does anyone know a workable solution for this?