gpt4 book ai didi

ios - 在 XCTest (UITesting) 中获取设备名称

转载 作者:搜寻专家 更新时间:2023-11-01 06:37:04 26 4
gpt4 key购买 nike

在为我的目标运行 UITesting 时,我很难找到设备名称。下面的代码在模拟器上运行时返回 MacBook 的名称。

UIDevice.current.name

最佳答案

那是因为您在 Mac 上运行,这就是它的名字。

UIDevice.current.name 返回

The name identifying the device.

检查引用 here UIDevice 必须用什么值来识别它自己和操作系统。

这就是获取设备名称的方法。

关于ios - 在 XCTest (UITesting) 中获取设备名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40277318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com