---
title: 云中的Appium自动化
description: 利用TestingBot大规模地运行自动化的Appium测试。在物理iOS和Android设备上运行Appium测试。
source_url:
  html: https://zh.testingbot.com/features/automation/appium
  md: https://zh.testingbot.com/features/automation/appium.md
---

Appium 1、2 和 3 已准备就绪 
# Appium云端自动化

在真实的 iOS 和 Android 设备上运行 Appium 测试。支持原生应用、混合应用和移动 Web 应用。具备强大的并行处理能力，可生成视频和日志，并保证 99.9% 的正常运行时间 SLA。

想了解所有平台？请查看[完整的自动化框架阵容](https://zh.testingbot.com/features)。

[免费开始](https://zh.testingbot.com/users/sign_up) [申请演示](https://testingbot.com/demo)

- **真实设备:** 200+
- **Appium 版本:** 1、2 和 3
- **正常运行时间服务级别协议:** 99.9%

_Appium 测试在 TestingBot 云平台上的真实 iOS、Android、三星和 Pixel 设备上运行_

被世界上一些最具创新性的公司所信任

 5线设置 
## 在真机上运行您现有的 Appium 脚本

将你的 Appium 驱动程序指向 TestingBot 中心，提供你的应用程序和功能，你的测试即可在几秒钟内于真正的 iPhone 或 Android 手机上运行。

 hub.testingbot.com Copy

 JavaScript Python Java Ruby C# PHP 

```javascript
// Run an Appium test on a real iPhone in the TestingBot cloud
const { remote } = require('webdriverio');

const driver = await remote({
  hostname: 'hub.testingbot.com',
  port: 443,
  protocol: 'https',
  capabilities: {
    'platformName': 'iOS',
    'appium:deviceName': 'iPhone 15',
    'appium:platformVersion': '18',
    'appium:app': 'tb://YOUR_APP_ID',
    'tb:options': { name: 'Checkout flow', realDevice: true }
  }
});

await driver.deleteSession();
```

```python
# Run an Appium test on a real Android device in the TestingBot cloud
from appium import webdriver
from appium.options.android import UiAutomator2Options

options = UiAutomator2Options()
options.platform_version = '14'
options.device_name = 'Galaxy S24'
options.app = 'tb://YOUR_APP_ID'
options.set_capability('tb:options', {'name': 'Checkout flow', realDevice: True})

driver = webdriver.Remote(
    'https://hub.testingbot.com/wd/hub',
    options=options
)
driver.quit()
```

```java
// Run an Appium test on a real iPhone in the TestingBot cloud
XCUITestOptions options = new XCUITestOptions()
    .setPlatformVersion("18")
    .setDeviceName("iPhone 15")
    .setApp("tb://YOUR_APP_ID");
options.setCapability("tb:options", Map.of("realDevice", true, "name", "Checkout flow"));

IOSDriver driver = new IOSDriver(
    new URL("https://KEY:SECRET@hub.testingbot.com/wd/hub"),
    options
);

driver.quit();
```

```ruby
# Run an Appium test on a real Android device in the TestingBot cloud
require 'appium_lib'

caps = {
  'platformName' => 'Android',
  'appium:deviceName' => 'Pixel 9',
  'appium:platformVersion' => '15',
  'appium:app' => 'tb://YOUR_APP_ID',
  'tb:options' => { name: 'Checkout flow', realDevice: true }
}

driver = Appium::Driver.new(
  { caps: caps, appium_lib: { server_url: 'https://hub.testingbot.com/wd/hub' } }, true
).start_driver
```

```csharp
// Run an Appium test on a real iPhone in the TestingBot cloud
var options = new AppiumOptions();
options.PlatformName = "iOS";
options.AddAdditionalAppiumOption("deviceName", "iPhone 15");
options.AddAdditionalAppiumOption("platformVersion", "18");
options.AddAdditionalAppiumOption("app", "tb://YOUR_APP_ID");
options.AddAdditionalAppiumOption("tb:options", new Dictionary<string, object> { { "realDevice", true }, { "name", "Checkout flow" } });

var driver = new IOSDriver(
    new Uri("https://KEY:SECRET@hub.testingbot.com/wd/hub"),
    options
);
driver.Quit();
```

```php
// Run an Appium test on a real Android device in the TestingBot cloud
$capabilities = [
    'platformName' => 'Android',
    'appium:deviceName' => 'Galaxy S24',
    'appium:platformVersion' => '14',
    'appium:app' => 'tb://YOUR_APP_ID',
    'tb:options' => ['realDevice' => true, 'name' => 'Checkout flow'],
];

$driver = RemoteWebDriver::create(
    'https://KEY:SECRET@hub.testingbot.com/wd/hub',
    $capabilities
);
$driver->quit();
```

Connected · [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/nodejs) [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/python) [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/java) [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/ruby) [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/csharp) [Dokumentation anzeigen](https://testingbot.com/support/app-automate/appium/php) 

使用与您已使用的相同的 WebDriver 协议，只需切换一个端点即可。有关完整示例，请参阅[TestingBot 上的 Appium](https://testingbot.com/support/app-automate/appium)文档。

 ![替换你的内部设备实验室](https://zh.testingbot.com/assets/features/appium/devicelab-75f7f33e3f397b019864f68f343211683c6d06a40e9334eda108d9f0d053297d.jpg)

 Real device cloud 
## 替换你的内部设备实验室

你不再需要购买、托管和维护iOS和Android设备。

每次 Appium 会话都会生成视频屏幕录像、Appium 服务器日志、设备日志、屏幕截图和网络 HAR 文件。您可以从我们的[REST API](https://testingbot.com/support/api)拉取这些工件，并直接将其发布到 Jira、Slack 或您的 CI 控制面板。

- 真正的 iPhone、iPad、Galaxy、Pixel 和 OnePlus 手机
- 原生、混合和移动 Web 应用
- 设备状态极佳，会话之间恢复出厂设置
- 每次测试均提供高清视频、日志和 HAR 数据
- 上传 IPA、APK 和 TestFlight 版本

 语言和框架 
## Appium框架

TestingBot与各种测试框架和服务集成。轻松地转换你现有的Appium测试，并与你最喜欢的CI/CD连接。

- ### [Java](https://testingbot.com/support/app-automate/appium/java)

  - [TestNG](https://testingbot.com/support/app-automate/appium/java/testng)
  - [JUnit](https://testingbot.com/support/app-automate/appium/java)

- ### [Python](https://testingbot.com/support/app-automate/appium/python)

  - [PyTest](https://testingbot.com/support/app-automate/appium/python)
  - [Robot Framework](https://testingbot.com/support/app-automate/appium/robotframework)

- ### [JavaScript](https://testingbot.com/support/app-automate/appium/nodejs)

  - [WebDriverIO](https://testingbot.com/support/app-automate/appium/nodejs/webdriverio)
  - [CodeceptJS](https://testingbot.com/support/app-automate/appium/nodejs/codeceptjs)

- ### [Ruby](https://testingbot.com/support/app-automate/appium/ruby)

  - [RSpec](https://testingbot.com/support/app-automate/appium/ruby)
  - [Cucumber](https://testingbot.com/support/app-automate/appium/ruby)

- ### [C#](https://testingbot.com/support/app-automate/appium/csharp)

  - [NUnit](https://testingbot.com/support/app-automate/appium/csharp/nunit)
  - [SpecFlow](https://testingbot.com/support/app-automate/appium/csharp/specflow)

- ### [PHP](https://testingbot.com/support/app-automate/appium/php)

  - [PHPUnit](https://testingbot.com/support/app-automate/appium/php)
  - [Codeception](https://testingbot.com/support/app-automate/appium/php)

刚接触 Appium？请阅读[Appium 快速入门指南](https://testingbot.com/support/app-automate/appium)，或直接跳转到下方特定语言的指南。

 大规模并行 
## 减少测试执行时间

与 TestingBot 移动设备云并行运行测试，加速测试执行。在各种真实设备上无缝测试，更快获得更可靠的结果。

- 最多 100 个并发 Appium 会话
- 会话秒速启动，无需设备排队
- 自动重试和智能设备分片

[免费开始](https://zh.testingbot.com/users/sign_up)

 ![减少测试执行时间](https://zh.testingbot.com/assets/features/selenium/parallel-0229d698e59a8a6b92fe50344a08634624f018331ecf8a849ef83cfb35e635a5.png)

Spoof device GPS
20+ regions

美国

英国

德国

法国

西班牙

比利时

澳大利亚

中国

日本

 地理位置测试 
## 在 20 多个地区测试您的应用

将设备的 GPS 定位伪造到世界任何地方，并在 iOS App Store、Google Play 和您自己的后端验证 **定位** 、 **地理定位** 和 **商店前端规则** 。

 安全设备 
## 真实设备。每次使用后均会清除数据。

每次 Appium 测试会话都会锁定一台真实设备，仅供您测试使用。测试结束后，设备将被恢复出厂设置，所有已安装的应用将被删除，缓存将被清除，设备将被放回设备池，供下一位客户使用。

符合 SOC 2 标准和 GDPR 要求，支持 SAML 单点登录和团队审计日志。

- 每次会话使用一台真实设备，绝不共享
- 每次会话之间恢复出厂设置
- 加密应用上传，并带有应用级保留控制

[访问 TestingBot 信任中心](https://trust.testingbot.com/)

1. 1

Your test locks one real device

A pristine iPhone or Android phone is reserved for your session only.

2. 2

Appium drives real hardware

Real sensors, real GPS, real biometrics. Native, hybrid or mobile web.

3. 3

Device factory-reset on release

Apps removed, caches cleared, accounts wiped. Returned clean to the pool.

 持续集成 
## 几分钟内即可将 Appium 集成到您的 CI/CD 流程中

TestingBot 可与所有主流 CI/CD 工具集成。每次提交代码时触发 Appium 测试套件，并将设备视频和日志流式传输回构建仪表板。

 ![Jenkins](https://zh.testingbot.com/assets/integrations/jenkins-e586a1c4af833e4c8d38d7b392a4e84bd193f30cae9cf8c9f198a58ec943a1ff.webp)

### [Jenkins](https://testingbot.com/support/integrations/ci-cd/jenkins)

 ![Bamboo](https://zh.testingbot.com/assets/integrations/bamboo-c8fe09a3cb0b74d6055e3aa6607d77720bfe29ff487b8e3cf825138adf634346.svg)

### [Bamboo](https://testingbot.com/support/integrations/ci-cd/bamboo)

 ![TeamCity](https://zh.testingbot.com/assets/integrations/teamcity-7e75cdb835903a4983ad276c41d95e569ceac5be486e96ec1f955029ce5bb319.svg)

### [TeamCity](https://testingbot.com/support/integrations/ci-cd/teamcity)

 ![CircleCI](https://zh.testingbot.com/assets/integrations/circleci-ede029654ff39b60342e4a5bba8fc9a3a49305cc38bda215b7cf8d07e85e0543.webp)

### [CircleCI](https://testingbot.com/support/integrations/ci-cd/circleci)

 ![GitLab CI](https://zh.testingbot.com/assets/integrations/gitlab-e4c0b6db07d07bc0a400f5606e258f4dc8a51b778e97bbfa51d1d531f3cb049a.webp)

### [GitLab CI](https://testingbot.com/support/integrations/ci-cd/gitlab)

 ![GitHub](https://zh.testingbot.com/assets/integrations/github-actions-8436242ad9e15381f84f1a98a10dddce15611087f121d6305782e211942b7842.webp)

### [GitHub](https://testingbot.com/support/integrations/ci-cd/github-actions)

 设备云 
## 真正的 iPhone、iPad、Galaxy 和 Pixel 设备

在您的客户实际使用的 iPhone、iPad、Galaxy、Pixel、OnePlus 和小米手机上进行测试。首发旗舰机型，同时涵盖广泛的旧款机型，确保向下兼容。

[查看所有设备](https://testingbot.com/support/app-automate/devices)

 ![Test online on iPhone 17 Pro](https://zh.testingbot.com/assets/devices/160h/44-6b4402c6996d9b1620879bb1123c40a6b36abb064e65dca0a1b3f05286779e9c.webp)

iPhone 17 Pro

 ![Test online on iPhone 17 Pro Max](https://zh.testingbot.com/assets/devices/160h/43-59d7e30684332ed4bf25567cbc09ca942eac46d925ccde8352d3e85812480f7d.webp)

iPhone 17 Pro Max

 ![Test online on iPhone 16 Pro](https://zh.testingbot.com/assets/devices/160h/42-de3704079345026847b739a5b1cf5332595904e54ede66abd988a76fb1e6593c.webp)

iPhone 16 Pro

 ![Test online on iPad (9th generation)](https://zh.testingbot.com/assets/devices/160h/41-70f7d18afde7620063a49a76cbfd088f8b59c742f3a5f4dd4a513dd6ec5c676c.webp)

iPad (9th generation)

 ![Test online on Galaxy S26](https://zh.testingbot.com/assets/devices/160h/40-e917ed08e15b5941fed75855ac457dd1df46b471a2020f081c4d70cefb68f4e8.webp)

Galaxy S26

 ![Test online on Huawei P40](https://zh.testingbot.com/assets/devices/160h/39-32a788c7e66a3da1c88eaaefefd37381f729e510f096b43906968b6907c44c57.webp)

Huawei P40

 Secure Tunnel 
## 测试与内部后端通信的应用程序

使用我们的[安全隧道](https://testingbot.com/support/tunnel)，让您的 Appium 测试能够访问私有 API、暂存环境以及在本地主机上运行的服务。

端到端加密，无需入站防火墙规则，开箱即用，适用于主流 CI 提供商。

 ![TestingBot secure tunnel for Appium](https://zh.testingbot.com/assets/features/tunnel-diagram-poster-8c25e19e6fe4f7276a46a96b31a0ad0e07bb4f5bf98dc192d2b70897cfbb1a26.png)

[阅读更多](https://zh.testingbot.com/support/tunnel)

 购买还是建造 
## TestingBot 与内部设备实验室的比较

自建和维护 iOS 和 Android 设备实验室成本高昂。设备会损坏，电池会膨胀，操作系统更新也层出不穷。以下是托管设备云的对比情况。

| 能力 | 测试机器人 | 内部设备实验室 |
| --- | --- | --- |
| 设备覆盖范围 | 真正的 iPhone、iPad、Galaxy、Pixel、OnePlus、小米，每次发布都会更新。 | 仅限于你能购买和自行组装的物品。 |
| 是时候进行首次测试了 | 几分钟之内，只需更改 Appium 驱动程序中的一个 URL。 | 数周的配置、MDM 和 Appium 服务器搭建 |
| 并行扩展 | 最多可按需支持 100 个并发会话 | 受您拥有的设备数量限制。 |
| 视频和日志 | 包含视频、设备日志、Appium 日志和 HAR | 自行实现录制和日志聚合 |
| 可靠性 | 99.9% 正常运行时间 SLA，全天候监控 | 你会更换没电的电池和破损的屏幕。 |
| 安全 | 设备在每次会话之间都会恢复出厂设置 | 手动清理，遗留状态风险 |
| 支持 | 全天候人工支持和专属客户服务经理 | Stack Overflow 和您自己的日志 |

常问问题
## TestingBot 上的 Appium — 常见问题解答

什么是 Appium？为什么要在 TestingBot 上运行它？

Appium 是一个开源的自动化框架，适用于原生应用、混合应用和移动 Web 应用。TestingBot 托管着大量真实的 iPhone、iPad、Galaxy 和 Pixel 设备，您可以使用现有的 Appium 脚本来驱动这些设备。只需将驱动程序指向`https://hub.testingbot.com/wd/hub` ，您的测试即可在几秒钟内运行在真实设备上。

支持哪些Appium版本？

TestingBot 支持 Appium 1、Appium 2 和 Appium 3，包括 Appium 2/3 插件以及最新的 XCUITest 和 UIAutomator2 驱动程序。您可以通过功能为每个测试指定特定的 Appium 服务器版本，这样您就可以在将新测试迁移到 Appium 3 的同时，保持旧版测试套件在 Appium 1 上运行。

我可以测试原生应用、混合应用和移动 Web 应用吗？

是的。TestingBot 支持所有三种 Appium 上下文：通过 XCUITest 测试原生 iOS 应用，通过 UIAutomator2 或 Espresso 测试原生 Android 应用，在 WebView 中测试混合应用，以及在真机上的 Safari 和 Chrome 浏览器中测试移动网页。

如何上传我的IPA或APK文件？

通过 REST API 或 CLI 将构建版本上传到[TestingBot Storage](https://testingbot.com/support/app-automate/help/upload) ，然后即可在 Appium 功能中引用它。构建版本可以按应用保留，以便快速重新运行。

我可以并行运行 Appium 测试吗？

是的。TestingBot 的计划包括在真实设备上同时运行多达 100 个 Appium 会话。每个会话都会锁定一台专用设备，因此测试之间不会相互干扰。

这些设备是真机还是模拟器？

TestingBot 的移动云平台使用真实的 iOS 和 Android 设备。我们也提供 iOS 模拟器和 Android 仿真器用于早期测试，但为了确保测试的准确性，我们默认并推荐使用真实设备。

我可以测试需要私有后端的应用吗？

安装我们的[安全隧道](https://testingbot.com/support/tunnel)后，您的 Appium 测试即可访问暂存 API、内部服务和本地主机。无需任何入站防火墙规则。

该设备云是否符合 SOC 2 / GDPR 标准？

TestingBot 符合 GDPR 法规，拥有欧盟数据驻留权，并通过了 ISO 27001 标准认证和 STAR 1 级认证。设备在每次会话之间都会恢复出厂设置，应用上传经过加密，企业版套餐提供 SAML 单点登录和审计日志功能。

## 更多喜爱 TestingBot 的理由

### 24/7 支持

有疑问？欢迎通过 24/7 应用内客服[聊天](https://zh.testingbot.com#)或[发送电子邮件联系我们](https://zh.testingbot.com/contact/new)。我们随时为您服务！

TestingBot 支持

嘿👋我们能帮上什么忙吗？

I need support

### 超过 14,000 个团队信赖

6M+

测试

120k+

用户

400+

企业

106

国家

[申请演示](https://testingbot.com/demo)

### 开发人员文档

将 TestingBot 集成到您的工作流程所需的一切。浏览适用于 Web 和移动测试的指南、API 参考和 SDK。

- [Appium Quickstart](https://testingbot.com/support/app-automate/appium)
- [App uploads (IPA / APK)](https://testingbot.com/support/app-automate/help/upload)
- [Available devices](https://testingbot.com/support/app-automate/devices)
- [CI/CD integration](https://testingbot.com/support/integrations/ci-cd)

[探索文档](https://testingbot.com/support)

### 企业级安全

STAR Level 1

Certified

GDPR

Compliant

SAML SSO

Single Sign-On

99.9%

Uptime SLA

[访问 TestingBot 信任中心](https://trust.testingbot.com/)

## 准备好开始Appium测试了吗？

要想开始，请看我们的[Appium测试](https://testingbot.com/support/app-automate/appium)文档或[预约演示](https://testingbot.com/demo)。

[开始免费试用](https://zh.testingbot.com/users/sign_up)

您可能喜欢的资源

[![Using Touch Actions with Appium](https://zh.testingbot.com/assets/resources/articles/24-490f70ad8a80e4534523707125b88e44e70fe19b126be4f44e689bbd5f6a0cbf.webp)](https://testingbot.com/resources/articles/touch-actions-appium)
### [Using Touch Actions with Appium](https://testingbot.com/resources/articles/touch-actions-appium)

Find out how to use Touch Actions with Appium.

[阅读更多](https://testingbot.com/resources/articles/touch-actions-appium)

[![Migrate from Appium 1.x to Appium 2.x](https://zh.testingbot.com/assets/resources/articles/27-121da26036885301ba438e1cdfc81e7ae8045cbc53c0dafaff5b4436000590b1.webp)](https://testingbot.com/resources/articles/appium-2-migration)
### [Migrate from Appium 1.x to Appium 2.x](https://testingbot.com/resources/articles/appium-2-migration)

Learn how to migrate from Appium 1 to the new Appium 2.

[阅读更多](https://testingbot.com/resources/articles/appium-2-migration)

[![Dark Mode Testing with Appium](https://zh.testingbot.com/assets/resources/articles/22-ed15fa0f3fde7566416fff5078b44689dc274439b2fb829f8c68603e909a65d6.webp)](https://testingbot.com/resources/articles/dark-mode-testing)
### [Dark Mode Testing with Appium](https://testingbot.com/resources/articles/dark-mode-testing)

Perform dark mode automated testing on iOS and Android with Appium.

[阅读更多](https://testingbot.com/resources/articles/dark-mode-testing)
