activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

用户界面自动化活动

上次更新日期 2026年1月14日

设备构建器类

使用此类配置要连接的设备。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

语法

public class DeviceBuilder
public class DeviceBuilder

DeviceBuilder类型公开以下成员。

构造函数

DeviceBuilder(
	string appiumUrl,
	string displayName
)
DeviceBuilder(
	string appiumUrl,
	string displayName
)

DeviceBuilder :初始化DeviceBuilder类的新实例。

appiumUrl String : Appium URL。

displayName String :设备名称(字符串)。

方法

您可以使用这些方法来构建设备。

构建

创建一个“ Device ”对象。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.Build()
public Device Build()
public Device Build()
返回值

用于创建连接的Device对象。

WithCapabilities

为设备配置其他所需功能。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithCapabilities
WithCapabilities(
	Dictionary<string, string> capabiltiies
)
WithCapabilities(
	Dictionary<string, string> capabiltiies
)

capabilities字典< String , String > : 设备的其他所需功能。请访问Appium 功能,了解您可以配置的其他功能。

返回值

DeviceBuilder

返回更新的设备构建器。

WithCapability

为设备配置单个功能。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithCapability(string, string)
WithCapability(
	string key,
	string value
)
WithCapability(
	string key,
	string value
)

key String : 要配置的功能的名称。:请访问Appium 功能,了解有关您可以配置的其他功能。

value String : 输入功能的值。

返回值

DeviceBuilder

返回更新的设备构建器。

WithDeviceName

指定设备名称。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.DeviceName(string)
WithDeviceName(
	string deviceName
)
WithDeviceName(
	string deviceName
)

deviceName String :要自动化的特定设备的名称 。(例如 iPhone 13)。

返回值

DeviceBuilder

返回更新的设备构建器。

WithHttpHeaders

将自定义 http 标头添加到 Appium 生成的默认标头中,以在使用代理后,提供更轻松的移动测试体验。自定义 Http 标头允许移动测试通过明确添加仅接受某些标头的代理使用这些标头。您添加的自定义标头不会覆盖已存在的标头,但系统会将标头添加到可支持的值的集合中。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithHttpHeaders(string)
WithHttpHeaders(
	Dictionary<string, string> headers
)
WithHttpHeaders(
	Dictionary<string, string> headers
)

headers字典< StringString > :要添加的自定义标头的名称和值。

返回值

DeviceBuilder

返回更新的设备构建器。

WithPlatformName

指定设备的平台名称。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithPlatformName(PaltformType)
WithPlatformName(
	PlatformType type
)
WithPlatformName(
	PlatformType type
)

type PlatformType :托管应用程序或浏览器的平台类型。

返回值

DeviceBuilder

返回更新的设备构建器。

WithPlatformVersion

指定设备平台的版本。

定义

命名空间:UiPath.MobileAutomation.API.Models

程序集:UiPath.MobileAutomation.API(在 UiPath.MobileAutomation.API.dll 中)

DeviceBuilder.WithPlatformVersion(string)
WithPlatformVersion(
	string version
)
WithPlatformVersion(
	string version
)

version String : 平台的版本。(例如,iOS 16)

返回值

DeviceBuilder

返回更新的设备构建器。

  • 定义
  • 语法
  • 构造函数
  • 方法
  • 构建
  • WithCapabilities
  • WithCapability
  • WithDeviceName
  • WithHttpHeaders
  • WithPlatformName
  • WithPlatformVersion

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2026 UiPath。保留所有权利。