ios - 无法为具有捆绑 ID 的真实 iOS 设备启动 appium 检查器

标签 ios appium appium-ios

我有一个连接到我的 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 {}

所以服务器启动正常。

最佳答案

所以,我做了什么:

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

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

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

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

我试图使用 bundleId 而不是应用程序路径。考虑如果我在设备上安装了应用程序,我可以在启动 appium 检查器时使用 bundleId。这并没有给出上述错误。

所以我切换到应用程序并使用绝对路径。 Appium 会先将应用安装到我的设备上,然后 appium inspector 就可以启动了。

关于ios - 无法为具有捆绑 ID 的真实 iOS 设备启动 appium 检查器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36339313/

相关文章:

ios - 如何为我的 CollectionView 单元格提供 onclick 功能?

android - Appium 错误 : Logcat capture failed: spawn ENOENT With Android Studio

android - ADB 命令在不知道 Activity 的情况下将 Android 应用程序恢复到前台

ios - 努力将 NSArray 解析为带有分隔符的字符串,以快速生成 QR 码

ios - 关于Swift中设置闹钟天数的问题

testing - 屏幕截图与 iOS 应用程序元素的坐标和大小不匹配

java - Appium:使用 XPath 通过部分 elementId/UID 查找元素

java - 启动appium浏览器时出错:- org. openqa.selenium.WebDriverException : ERROR running Appium command: Arguments to path.解析必须是字符串

ios - ld : library not found for -lFirebaseCore in Xcode react native

java - 如何创造倾城历史