0

我有一个连接到我的 Mac Book Pro 的真实设备(Ipad Mini)。使用我正在尝试测试的应用程序已经安装在 Ipad Mini 上。我在启动服务器后尝试运行 Appium 检查器。但不幸的是,Appium Inspector 正在尝试安装该应用程序但失败了。它不只是使用已经提供的捆绑 ID 并继续打开应用程序,而不是尝试使用空白应用程序路径安装它。

我想知道如何正确设置它?

这是错误的日志:

info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.4","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPad Mini"}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.5.7 Darwin/14.5.0 (x86_64)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 3336a71d-7695-44fb-9ee2-eaacae01c4bd
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Auto-detecting iOS udid...
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.xxxxxxxxx/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.xxxxxxxxxx/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/rj2501511/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/rj2501511/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js

info: [debug] Reusing dynamic bootstrap: /Users/rj2501511/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

info: [debug] App is not installed. Will try to install the app.

info: [debug] Cleaning up appium session

info: [debug] Error: Installing com.xxxxxxxxxx failed
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/node-idevice/main.js:159:6
    at ChildProcess.exithandler (child_process.js:742:7)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

error: Failed to start an Appium session, err was: Error: Installing com.xxxxxxxxx failed

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Installing com.xxxxxxxx failed)","origValue":"Installing com.xxxxxxx failed"},"sessionId":null}
info: <-- POST /wd/hub/session 500 3264.173 ms - 192

Appium 服务器设置:

使用 Appium UI,我填写了以下内容:

BundleID: com.xxx.xxxx.xxxx
Force Device: Ipad Mini
Platform Version: 8.4
UDID: xxxxxxxxxxxxxxxxxxx
Show Simulator Log: checked

然后我通过单击“启动”继续启动 Appium 服务器

生成以下日志:

info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)

info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"app":"com.xxxxxxxxx","udid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxx","address":"127.0.0.1","deviceName":"iPad Mini","platformName":"iOS","platformVersion":"8.4","showIOSLog":true,"defaultCommandTimeout":7200,"debugLogSpacing":true}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}

info: <-- GET /wd/hub/status 200 6.923 ms - 105 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}

info: --> GET /wd/hub/status {}

所以服务器启动正常。

4

1 回答 1

1

所以,我做了什么:

通过大量文档和阅读,我发现基本要求是:

1) app - .ipa 或 .app 文件的绝对路径

2) udid - 用于真实设备自动化的设备

3) deviceName - 这可以是任何东西,它不能是空值

我试图使用 bundleId 而不是应用程序路径。想想如果我在设备上安装了应用程序,我可以在启动 appium 检查器时使用 bundleId 。给出上述错误是行不通的。

所以我切换到应用程序并使用绝对路径。Appium 将首先将应用程序安装到我的设备上,并且 appium 检查器能够启动。

于 2016-04-21T19:30:12.927 回答