如何使用Appium从jenkins URL安装应用程序?

时间:2016-02-29 12:50:36

标签: java jenkins appium appium-ios

如何使用Appium从jenkins网址安装* .ipa?

  @Before
  DesiredCapabilities capabilities = new DesiredCapabilities();
  capabilities.setCapability("deviceName", "Tester's mini Retina");
  capabilities.setCapability("platformName", "iOS");
  capabilities.setCapability("platformVersion", "9.2");
  capabilities.setCapability("udid", "3d54a856d44eda56ea19bb7e43c155");
  **capabilities.setCapability("app", "http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa");**
  driver = new IOSDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

错误:

Failed to start an Appium session, err was: Error: Bad app: 
http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa. 
App paths need to be absolute, or relative to the appium server install dir, 
or a URL to compressed file, or a special app name. cause: Error testing zip 
archive, are you sure this is a zip file? Error: Command failed: /bin/sh -c 
unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/116129-4973-z1mwjw/appium-app.zip`

2 个答案:

答案 0 :(得分:0)

您的应用是否已使用开发者资料或分发资料进行签名?和Appium日志在这里更有帮助来找出问题。

答案 1 :(得分:0)

info: [debug] Using downloadable app from desired caps: http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa info: [debug] http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa downloaded to /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip info: [debug] Unzipping /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip info: [debug] Testing zip archive: /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip error: Test zip archive threw error Error: Command failed: /bin/sh -c unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip

info: [debug] Got configuration error, not starting session info: [debug] Cleaning up appium session error: Stderr: [/var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip or /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip.zip, and cannot find /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip.ZIP, period. error: Stdout: error: Failed to start an Appium session, err was: Error: Bad app: http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error testing zip archive, are you sure this is a zip file? Error: Command failed: /bin/sh -c unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip

info: [debug] Error: Bad app: http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error testing zip archive, are you sure this is a zip file? Error: Command failed: /bin/sh -c unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip

at [object Object].<anonymous> (/Users/aap/Temp/Appium/appium/lib/devices/ios/ios.js:188:13)
at [object Object].<anonymous> (/Users/aap/Temp/Appium/appium/lib/devices/device.js:134:11)
at [object Object].<anonymous> (/Users/aap/Temp/Appium/appium/lib/devices/device.js:169:7)
at /Users/aap/Temp/Appium/appium/lib/helpers.js:151:11
at /Users/aap/Temp/Appium/appium/lib/helpers.js:81:7
at /Users/aap/Temp/Appium/appium/lib/helpers.js:116:9
at ChildProcess.exithandler (child_process.js:220:5)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Bad app: http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error testing zip archive, are you sure this is a zip file? ``Error: Command failed: /bin/sh -c unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip\n)","origValue":"Bad app: http://10.65.5.167:8080/job/Lime%20iPad/ws/build/artifacts/LimeDemo-2.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error testing zip archive, are you sure this is a zip file? Error: Command failed: /bin/sh -c unzip -tq /var/folders/sv/fwvlgylj26z757f6hvjgvj3w0000gn/T/11621-4451-3ob9sk/appium-app.zip\n"},"sessionId":null}

info: <-- POST /wd/hub/session 500 111.717 ms - 936