Appium + Jenkins + Real设备IOS

时间:2018-03-03 07:23:46

标签: jenkins appium appium-ios

我需要你的帮助)

我需要在jenkins的ios真实设备上运行appium test。我在本地机器上有jenkins。

我的设置测试:

c

apabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.2.1");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Iphone");
capabilities.setCapability(MobileCapabilityType.UDID, 74859bb7c435945dafd8691be871ef96905030322);
capabilities.setCapability(MobileCapabilityType.APP, "/Users/TEST/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Build/Products/Debug-iphoneos/IntegrationApp.app");

测试成功运行,如果我在Intellij Idea + maven(mvn测试)中运行它但是当我在jenkins中运行测试时我有错误:

/START APPIUM SERVER/....
[Appium] Creating new XCUITestDriver (v2.68.0) session
[Appium] Capabilities:
[Appium] app: /Users/TEST/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Build/Products/Debug-iphoneos/IntegrationApp.app
[Appium] platformVersion: 11.2.1
[Appium] platformName: IOS
[Appium] udid: 74859bb7c435945dafd8691be871ef96905030322
[Appium] deviceName: Iphone
[BaseDriver] Expected W3C "capabilities" to be a JSON Object but was provided with: []
[BaseDriver] Falling back to MJSONWP desired capabilities
[BaseDriver] Session created with session id: b1797f6a-47ec-4dfc-8099-abc01aeaf878
[XCUITest] The 'idevice_id' program is not installed. If you are running a real device test it is necessary. Install with 'brew install libimobiledevice --HEAD'
[XCUITest] Error: Unknown device or simulator UDID: '74859bb7c435945dafd8691be871ef96905030322'

但是已经安装了libimobiledevice

请帮帮我!

1 个答案:

答案 0 :(得分:0)

您的问题似乎与您的环境有关。 您必须注意的一件事是Jenkins代理运行的Jenkins测试将使用“Jenkins”用户。也许,那是你问题的根源。

您是否尝试在托管jenkins代理的计算机上以Jenkins身份登录并从命令行运行idevice_id以查看它是否找到了?

如果找不到,请尝试使用Intellij找到环境差异。 也许您使用Intellij与不同的用户? 你可以从intellij做的一件事是使用控制台并输入: which idevice_id  看看Intellij在哪里找到它......

所以,没有直接答案,但也许这会对你有帮助......

此致

卢瓦克