UI测试执行完成后Xcode未生成memgraph文件,如何解决?
UI测试执行后Xcode未生成memgraph文件的解决疑问
我正在学习WWDC 2021的《Detect and diagnose memory》视频,视频中提到UI测试执行完毕后会自动生成memgraph文件。我创建了新项目并添加了UI测试,但测试完成后,我的Xcode 14.2并未生成任何memgraph文件。
以下是参照视频示例编写的测试代码:
func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() let options = XCTMeasureOptions() options.invocationOptions = [.manuallyStart] measure( metrics: [XCTMemoryMetric(application: app)], options: options ) { app.launch() startMeasuring() app.staticTexts["Abandoned Memory Example"].tap() app.buttons["Scenarios"].tap() app.staticTexts["Leaks Memory Example"].tap() let simulateLogoutThenLoginActionButton = app.buttons["Simulate Logout then Login Action"] simulateLogoutThenLoginActionButton.tap() simulateLogoutThenLoginActionButton.tap() simulateLogoutThenLoginActionButton.tap() simulateLogoutThenLoginActionButton.tap() XCTAssertTrue(true) } }
我已经尝试过以下操作:
- 在UI Test scheme中取消勾选“Attachments: Delete when each test succeeds”
- 勾选了“Malloc Stack Logging”
请问该如何设置才能让Xcode在UI测试执行完成后生成memgraph文件?
内容的提问来源于stack exchange,提问作者Hoang Anh Tuan
相关产品推荐
相关产品推荐

