0
0

AppiumのiOS実機テストでWebDriverAgentのインストールに失敗するとき

Last updated at Posted at 2024-09-08

背景

AppiumをPythonで動かすにあたって、iOSの実機を接続して実行すると以下のようなエラーが発生した。(Tracebackから抜粋)

UnknownError: An unknown server-side error occurred while processing the command. 
Original error: Unable to launch WebDriverAgent because of xcodebuild failure: 
xcodebuild failed with code 65. This usually indicates an issue with the local Xcode
setup or WebDriverAgent project configuration or the driver-to-platform version 
mismatch. Consider checking the WebDriverAgent configuration guide for real iOS devices
at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-
config.md.. Make sure you follow the tutorial at https://appium.github.io/appium-
xcuitest-driver/latest/preparation/real-device-config/. Try to remove the 
WebDriverAgentRunner application from the device if it is installed and reboot the device.

要約するとWebDriverAgent(AppiumからiOSを操作するためのアプリ)のインストールに失敗している状態。

試したこと

  • Appiumの再インストール → 変化なし
  • Appiumのダウングレード → 変化なし
  • WebDriverAgentのprofileの再認証 → 解決

解決策の背景

WebDriverAgentはAppiumのプラグイン「xcuitest」内にXCodeのプロジェクトとして配置されている。

プロジェクトへのパスは以下の通り。(Mac環境)
/User/XXX/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj

補足:Appiumへのプラグインは$HOME/.appiumに配置される。

解決

このxcodeprojを開き、Project:WebDriverAgentのTarget:WebDriverAgentRunnerを選択し、Signing&Capabilitiesのタブを開くとTeamが未選択の状態になっていると思われるので、ここで自身のAppleIDを設定する。
これを行うとBundle Identifierを変更するよう促されるので、適当な文字列を設定する。

そしてテストを行いたいiPhoneをビルドターゲットに設定し、▶️ボタンを押してビルドを実施しておく。


ここまで完了したらWebDriverAgentのインストールが成功するようになるので、Appiumテストが実行できるようになるはず。

お気持ち

日本語で手に入るAppium関連の情報が少ないのでこれからも投稿していきたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0