jpskill.com
🛠️ 開発・MCP コミュニティ

appium

Appiumは、iOSやAndroidのモバイルアプリのテストを自動化したい場合に活用でき、「appium」「モバイル自動化」「iOSテスト」「Androidテスト」といったキーワードが出てきた際に、テスト作業を効率化するSkill。

📜 元の英語説明(参考)

When the user wants to automate mobile app testing on iOS and Android using Appium. Also use when the user mentions "appium," "mobile automation," "iOS testing," "Android testing," "mobile WebDriver," "XCUITest," or "UiAutomator." For React Native-specific testing, see detox.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Appiumは、iOSやAndroidのモバイルアプリのテストを自動化したい場合に活用でき、「appium」「モバイル自動化」「iOSテスト」「Androidテスト」といったキーワードが出てきた際に、テスト作業を効率化するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o appium.zip https://jpskill.com/download/14641.zip && unzip -o appium.zip && rm appium.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14641.zip -OutFile "$d\appium.zip"; Expand-Archive "$d\appium.zip" -DestinationPath $d -Force; ri "$d\appium.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して appium.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → appium フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Appium

概要

あなたは、WebDriver プロトコル上に構築されたクロスプラットフォームのモバイル自動化フレームワークである Appium のエキスパートです。iOS および Android テストのために Appium をセットアップし、信頼性の高いテストスクリプトを作成し、desired capabilities を構成し、モバイル固有のジェスチャを処理し、モバイルテストを CI に統合するのを支援します。XCUITest (iOS) と UiAutomator2 (Android) ドライバーの違いを理解しています。

手順

初期評価

  1. Platform — iOS、Android、または両方ですか?
  2. App type — ネイティブ、ハイブリッド、またはモバイルウェブですか?
  3. Language — JavaScript、Python、Java、または Ruby ですか?
  4. Environment — 実機ですか、それともシミュレーター/エミュレーターですか?

セットアップ

# setup-appium.sh — Appium をインストールし、環境を検証します。
# 必要な依存関係がすべて利用可能であることを確認します。

# Appium をインストール
npm install -g appium

# プラットフォームドライバーをインストール
appium driver install uiautomator2
appium driver install xcuitest

# セットアップを検証
appium driver list --installed

# 環境要件を確認
npx appium-doctor --android
npx appium-doctor --ios

Capabilities Configuration

// capabilities.js — iOS および Android 用の Appium desired capabilities。
// テストするデバイス、OS バージョン、およびアプリを定義します。
const androidCaps = {
  platformName: 'Android',
  'appium:automationName': 'UiAutomator2',
  'appium:deviceName': 'Pixel 7',
  'appium:platformVersion': '14',
  'appium:app': '/path/to/app.apk',
  'appium:autoGrantPermissions': true,
  'appium:noReset': false,
};

const iosCaps = {
  platformName: 'iOS',
  'appium:automationName': 'XCUITest',
  'appium:deviceName': 'iPhone 15',
  'appium:platformVersion': '17.4',
  'appium:app': '/path/to/app.ipa',
  'appium:autoAcceptAlerts': true,
};

テストスクリプト (JavaScript with WebDriverIO)

// tests/login.spec.js — モバイルログインフローの Appium テスト。
// ログイン成功とエラー処理の両方をテストします。
describe('Login Screen', () => {
  it('should login with valid credentials', async () => {
    const emailField = await $('~email-input');
    await emailField.setValue('user@example.com');

    const passwordField = await $('~password-input');
    await passwordField.setValue('password123');

    const loginButton = await $('~login-button');
    await loginButton.click();

    const welcomeText = await $('~welcome-message');
    await welcomeText.waitForDisplayed({ timeout: 10000 });
    await expect(welcomeText).toHaveText('Welcome back');
  });

  it('should show error on invalid credentials', async () => {
    const emailField = await $('~email-input');
    await emailField.setValue('wrong@example.com');

    const passwordField = await $('~password-input');
    await passwordField.setValue('wrongpass');

    const loginButton = await $('~login-button');
    await loginButton.click();

    const errorMsg = await $('~error-message');
    await errorMsg.waitForDisplayed({ timeout: 5000 });
    await expect(errorMsg).toHaveText('Invalid credentials');
  });
});

Python テスト

# tests/test_app.py — Python と pytest を使用した Appium テスト。
# 要素の検索、ジェスチャ、およびアサーションを示します。
import pytest
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

@pytest.fixture
def driver():
    options = UiAutomator2Options()
    options.platform_name = "Android"
    options.device_name = "emulator-5554"
    options.app = "./app-debug.apk"
    d = webdriver.Remote("http://localhost:4723", options=options)
    yield d
    d.quit()

def test_add_item(driver):
    wait = WebDriverWait(driver, 10)
    add_button = wait.until(
        EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "add-item"))
    )
    add_button.click()

    name_field = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "item-name")
    name_field.send_keys("Test Item")

    save_button = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "save-button")
    save_button.click()

    item = wait.until(
        EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "item-Test Item"))
    )
    assert item.is_displayed()

モバイルジェスチャ

// gestures.js — Appium の一般的なモバイルジェスチャ。
// スクロール、スワイプ、長押し、ピンチ操作によるズーム。

// 下にスクロール
await driver.execute('mobile: scrollGesture', {
  left: 100, top: 500, width: 200, height: 500,
  direction: 'down', percent: 1.0,
});

// 左にスワイプ (例: カードを閉じる)
const card = await $('~card-element');
await driver.execute('mobile: swipeGesture', {
  elementId: card.elementId,
  direction: 'left', percent: 0.75,
});

// 長押し
const item = await $('~list-item');
await driver.execute('mobile: longClickGesture', {
  elementId: item.elementId, duration: 2000,
});

WebDriverIO Config

// wdio.conf.js — Appium モバイルテスト用の WebDriverIO 構成。
// Android と iOS の両方のテストスイートを構成します。
exports.config = {
  runner: 'local',
  port: 4723,
  specs: ['./tests/**/*.spec.js'],
  capabilities: [{
    platformName: 'Android',
    'appium:automationName': 'UiAutomator2',
    'appium:deviceName': 'Pixel_7_API_34',
    'appium:app': './app/build/outputs/apk/debug/app-debug.apk',
  }],
  framework: 'mocha',
  mochaOpts: { timeout: 60000 },
  services: ['appium'],
};
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Appium

Overview

You are an expert in Appium, the cross-platform mobile automation framework built on the WebDriver protocol. You help users set up Appium for iOS and Android testing, write reliable test scripts, configure desired capabilities, handle mobile-specific gestures, and integrate mobile tests into CI. You understand the differences between XCUITest (iOS) and UiAutomator2 (Android) drivers.

Instructions

Initial Assessment

  1. Platform — iOS, Android, or both?
  2. App type — Native, hybrid, or mobile web?
  3. Language — JavaScript, Python, Java, or Ruby?
  4. Environment — Real devices or simulators/emulators?

Setup

# setup-appium.sh — Install Appium and verify the environment.
# Checks that all required dependencies are available.

# Install Appium
npm install -g appium

# Install platform drivers
appium driver install uiautomator2
appium driver install xcuitest

# Verify setup
appium driver list --installed

# Check environment requirements
npx appium-doctor --android
npx appium-doctor --ios

Capabilities Configuration

// capabilities.js — Appium desired capabilities for iOS and Android.
// Defines which device, OS version, and app to test.
const androidCaps = {
  platformName: 'Android',
  'appium:automationName': 'UiAutomator2',
  'appium:deviceName': 'Pixel 7',
  'appium:platformVersion': '14',
  'appium:app': '/path/to/app.apk',
  'appium:autoGrantPermissions': true,
  'appium:noReset': false,
};

const iosCaps = {
  platformName: 'iOS',
  'appium:automationName': 'XCUITest',
  'appium:deviceName': 'iPhone 15',
  'appium:platformVersion': '17.4',
  'appium:app': '/path/to/app.ipa',
  'appium:autoAcceptAlerts': true,
};

Test Script (JavaScript with WebDriverIO)

// tests/login.spec.js — Appium test for mobile login flow.
// Tests both successful login and error handling.
describe('Login Screen', () => {
  it('should login with valid credentials', async () => {
    const emailField = await $('~email-input');
    await emailField.setValue('user@example.com');

    const passwordField = await $('~password-input');
    await passwordField.setValue('password123');

    const loginButton = await $('~login-button');
    await loginButton.click();

    const welcomeText = await $('~welcome-message');
    await welcomeText.waitForDisplayed({ timeout: 10000 });
    await expect(welcomeText).toHaveText('Welcome back');
  });

  it('should show error on invalid credentials', async () => {
    const emailField = await $('~email-input');
    await emailField.setValue('wrong@example.com');

    const passwordField = await $('~password-input');
    await passwordField.setValue('wrongpass');

    const loginButton = await $('~login-button');
    await loginButton.click();

    const errorMsg = await $('~error-message');
    await errorMsg.waitForDisplayed({ timeout: 5000 });
    await expect(errorMsg).toHaveText('Invalid credentials');
  });
});

Python Test

# tests/test_app.py — Appium test using Python and pytest.
# Demonstrates element finding, gestures, and assertions.
import pytest
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

@pytest.fixture
def driver():
    options = UiAutomator2Options()
    options.platform_name = "Android"
    options.device_name = "emulator-5554"
    options.app = "./app-debug.apk"
    d = webdriver.Remote("http://localhost:4723", options=options)
    yield d
    d.quit()

def test_add_item(driver):
    wait = WebDriverWait(driver, 10)
    add_button = wait.until(
        EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "add-item"))
    )
    add_button.click()

    name_field = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "item-name")
    name_field.send_keys("Test Item")

    save_button = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "save-button")
    save_button.click()

    item = wait.until(
        EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "item-Test Item"))
    )
    assert item.is_displayed()

Mobile Gestures

// gestures.js — Common mobile gestures in Appium.
// Scroll, swipe, long-press, and pinch-to-zoom.

// Scroll down
await driver.execute('mobile: scrollGesture', {
  left: 100, top: 500, width: 200, height: 500,
  direction: 'down', percent: 1.0,
});

// Swipe left (e.g., dismiss card)
const card = await $('~card-element');
await driver.execute('mobile: swipeGesture', {
  elementId: card.elementId,
  direction: 'left', percent: 0.75,
});

// Long press
const item = await $('~list-item');
await driver.execute('mobile: longClickGesture', {
  elementId: item.elementId, duration: 2000,
});

WebDriverIO Config

// wdio.conf.js — WebDriverIO configuration for Appium mobile tests.
// Configures both Android and iOS test suites.
exports.config = {
  runner: 'local',
  port: 4723,
  specs: ['./tests/**/*.spec.js'],
  capabilities: [{
    platformName: 'Android',
    'appium:automationName': 'UiAutomator2',
    'appium:deviceName': 'Pixel_7_API_34',
    'appium:app': './app/build/outputs/apk/debug/app-debug.apk',
  }],
  framework: 'mocha',
  mochaOpts: { timeout: 60000 },
  services: ['appium'],
};