Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

swift - How to cancel a call with XCTest for iOS 14

Hi I'm writing some XCTest in Swift for iOS 14.

Back in iOS 13 the springboard handled the call screen and you could end a call with

let app = XCUIApplication(bundleIdentifier: "com.apple.springboard")

app.buttons["End call"].firstMatch.tap()

However the springboard does not seem to contain the end call button for iOS 14! So how do you end a call in iOS 14?

question from:https://stackoverflow.com/questions/66048747/how-to-cancel-a-call-with-xctest-for-ios-14

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can try to inspect what application is displayed by reading Apple's Console application output. (Search for FBApplication)

Probably, you need to interact with the Phone application instead of Springboard

Bundle identifiers of iOS apps: https://github.com/rzakhar/XCTApps/blob/master/Sources/XCTApps/iOS.swift


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...