ios - 真实设备上的 Appium 检查器 - iOS

标签 ios ios-ui-automation appium

我正在评估 Appium 是否适合我的 iOS 自动化测试。作为其中的一部分,当我选择我的设备目标作为 iPhone 模拟器时,我能够成功执行 appium element Inspector。但当我瞄准真实设备时,我无法调用元素检查器。

我已经使用开发配置文件签署了我的应用程序,并且我能够从 Xcode 5 安装并运行我的应用程序。因此,我的应用程序设置看起来不错,因为我能够运行我的应用程序。

然后我在 Appium.app GUI 中配置了所有详细信息,如捆绑 ID、设备等...并启动了 appium 服务器和检查器。当检查器启动时,我的应用程序在设备中成功打开,但它没有执行任何进一步的操作,几秒钟后,我收到一个弹出消息“请确保 appium 服务器正在运行并且当前已设置 APP_PATH......” ”

我调用了一些调试日志,但无法从日志中找出问题所在。附加日志

info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)

debug: Non-default server args: {"app":"com.bharathapp.npuzzle","udid":"a3c3ccbed22942bd7866cbf3751363004acec0a8","address":"127.0.0.1","sessionOverride":true,"fullReset":true,"deviceName":"iPhone Retina (4-inch 64-bit)","orientation":"Portrait","showSimulatorLog":true,"defaultCommandTimeout":7200}

info: Appium REST http interface listener started on 127.0.0.1:4723
info: LogLevel: debug

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

debug: Appium request initiated at /wd/hub/status

debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}

info: <-- GET /wd/hub/status 200 7.573 ms - 104 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}

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

debug: Appium request initiated at /wd/hub/status

info: <-- GET /wd/hub/status 200 2.758 ms - 104 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}

debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}

debug: Appium request initiated at /wd/hub/status

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

debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}
debug: Appium request initiated at /wd/hub/sessions
debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":[]}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platformName":"iOS","platformVersion":"7.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPhone Retina (4-inch 64-bit)"}}
debug: App is an iOS bundle, will attempt to run as pre-existing
debug: Creating new appium session c8bdf0b6-ee57-47ce-ac74-da6ef6d01a27
debug: Removing any remaining instruments sockets
debug: Cleaned up instruments socket /tmp/instruments_sock
debug: Cleaning up any tracedirs
debug: No tracedirs to clean up
debug: Setting Xcode folder
debug: Setting Xcode version
debug: Setting iOS SDK Version
debug: iOS SDK Version set to 7.1
debug: Detecting automation tracetemplate
debug: Not auto-detecting udid, running on sim
debug: Localizable.strings is not currently supported when using real devices.
debug: Not setting locale because we're using a real device
debug: Creating instruments
debug: Preparing uiauto bootstrap
debug: Dynamic bootstrap dir: /Users/BharathMBA/Library/Application Support/appium/bootstrap
debug: Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js"}
debug: Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

#import "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js";

bootstrap({
  nodePath: "/Applications/Appium.app/Contents/Resources/node/bin/node",
  commandProxyClientPath: "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js",
});
debug: Dynamic bootstrap path: /Users/BharathMBA/Library/Application Support/appium/bootstrap/bootstrap-fe8fa37a970f98cc.js
debug: Reusing dynamic bootstrap: /Users/BharathMBA/Library/Application Support/appium/bootstrap/bootstrap-fe8fa37a970f98cc.js
debug: Not setting iOS and app preferences since we're on a real device
debug: Starting iOS device log capture via idevicesyslog
debug: Not setting device type since we're connected to a device
debug: Real device specified but no ipa or app path, assuming bundle ID is on device
debug: Starting command proxy.
debug: Instruments socket server started at /tmp/instruments_sock
debug: Starting instruments
debug: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
debug: Attempting to run app on real device with UDID a3c3ccbed22942bd7866cbf3751363004acec0a8
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w a3c3ccbed22942bd7866cbf3751363004acec0a8 com.bharathapp.npuzzle -e UIASCRIPT /Users/BharathMBA/Library/Application Support/appium/bootstrap/bootstrap-fe8fa37a970f98cc.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {}
debug: And launch timeouts (in ms): {"global":90000}
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:15 Bharath DTMobileIS[10421] <Warning>: Could not create service named com.apple.instruments.server.services.filebrowser
info: <-- GET /wd/hub/status 200 1.234 ms - 104 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}}}
info: --> GET /wd/hub/sessions {}
info: <-- GET /wd/hub/sessions 200 15.674 ms - 23 {"status":0,"value":[]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"7.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPhone Retina (4-inch 64-bit)"}}
info: Launching instruments
info: --> GET /wd/hub/status {}
info: <-- GET /wd/hub/status 200 1.998 ms - 155 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"c8bdf0b6-ee57-47ce-ac74-da6ef6d01a27"}
warn: Instruments socket client never checked in; timing out (global)
info: Launching instruments
info: <-- POST /wd/hub/session - - ms - - 


debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:15 Bharath DTMobileIS[10421] <Warning>: Could not create service named com.apple.instruments.server.services.launchdaemon
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:15 Bharath DTMobileIS[10421] <Warning>: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:16 Bharath kernel[0] <Debug>: launchd[10422] Container: /private/var/mobile/Applications/A264164B-EEDE-43CF-80AF-6972D5C0E829 (sandbox)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:16 Bharath backboardd[28] <Error>: HID: The 'Passive' connection 'npuzzle' access to protected services is denied.
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:16 Bharath networkd[82] <Warning>: Analytics Engine: double ON for app: com.bharathapp.npuzzle
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Warning>: CLTilesManagerClient: initialize, sSharedTilesManagerClient
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Warning>: CLTilesManagerClient: init
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Warning>: CLTilesManagerClient: reconnecting, 0x15d914b0
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath AdSheet[10418] <Warning>: [AppDeveloper] Fill rate for development application 'com.bharathapp.npuzzle': 80.0%
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Error>: CoreLocation: could not chmod /var/mobile/Library/Preferences/com.apple.CoreMotion.plist errno 2 (No such file or directory)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Error>: CoreLocation: could not chown /var/mobile/Library/Preferences/com.apple.CoreMotion.plist errno 2 (No such file or directory)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:17 Bharath DTMobileIS[10421] <Warning>: -[UIAutomationService _startUpAgent]: posix_spawn(): Resource temporarily unavailable
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:35 Bharath lockdownd[52] <Notice>: 00281000 _select_socket: receive secure message timeout!
debug: [IOS_SYSLOG_ROW ] Aug 14 09:35:35 Bharath lockdownd[52] <Notice>: 00281000 _receive_message: walk away - non-SSL 1
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:06 Bharath AdSheet[10418] <Warning>: [AppDeveloper] Fill rate for development application 'com.bharathapp.npuzzle': 80.0%
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:06 Bharath AdSheet[10418] <Warning>: [AppDeveloper] Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:06 Bharath npuzzle[10422] <Warning>: The operation couldn’t be completed. Ad inventory unavailable
debug: Appium request initiated at /wd/hub/status
debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"c8bdf0b6-ee57-47ce-ac74-da6ef6d01a27"}
debug: Killall instruments
debug: [INSTSERVER] Instruments exited with code null
debug: Killall instruments
debug: Attempting to retry launching instruments, this is retry #1
debug: Killall iPhoneSimulator
debug: Attempting to run app on real device with UDID a3c3ccbed22942bd7866cbf3751363004acec0a8
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w a3c3ccbed22942bd7866cbf3751363004acec0a8 com.bharathapp.npuzzle -e UIASCRIPT /Users/BharathMBA/Library/Application Support/appium/bootstrap/bootstrap-fe8fa37a970f98cc.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {}
debug: An
d launch timeouts (in ms): {"global":90000}
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:50 Bharath DTMobileIS[10423] <Warning>: Could not create service named com.apple.instruments.server.services.filebrowser
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:50 Bharath DTMobileIS[10423] <Warning>: Could not create service named com.apple.instruments.server.services.launchdaemon
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:50 Bharath DTMobileIS[10423] <Warning>: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:51 Bharath com.apple.launchd[1] (UIKitApplication:com.bharathapp.npuzzle[0x3713][10422]) <Notice>: (UIKitApplication:com.bharathapp.npuzzle[0x3713]) Exited: Killed: 9
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:51 Bharath backboardd[28] <Warning>: Application 'UIKitApplication:com.bharathapp.npuzzle[0x3713]' exited abnormally with signal 9: Killed: 9
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:51 Bharath AdSheet[10418] <Warning>: tcp_connection_set_source_application proc_pidinfo PROC_PIDUNIQIDENTIFIERINFO for pid 10422 failed
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:51 Bharath AdSheet[10418] <Error>: tcp_connection_host_start 8 DNSServiceCreateDelegateConnection failed: -65555
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:52 Bharath AdSheet[10418] <Warning>: tcp_connection_set_source_application proc_pidinfo PROC_PIDUNIQIDENTIFIERINFO for pid 10422 failed
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:52 Bharath AdSheet[10418] <Error>: tcp_connection_host_start 11 DNSServiceCreateDelegateConnection failed: -65555
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath kernel[0] <Debug>: launchd[10424] Container: /private/var/mobile/Applications/A264164B-EEDE-43CF-80AF-6972D5C0E829 (sandbox)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath backboardd[28] <Error>: HID: The 'Passive' connection 'npuzzle' access to protected services is denied.
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Warning>: CLTilesManagerClient: initialize, sSharedTilesManagerClient
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Warning>: CLTilesManagerClient: init
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Warning>: CLTilesManagerClient: reconnecting, 0x1656a780
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath AdSheet[10418] <Warning>: [AppDeveloper] Fill rate for development application 'com.bharathapp.npuzzle': 80.0%
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath AdSheet[10418] <Warning>: [AppDeveloper] Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath npuzzle[10424] <Warning>: The operation couldn’t be completed. Ad inventory unavailable
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Error>: CoreLocation: could not chmod /var/mobile/Library/Preferences/com.apple.CoreMotion.plist errno 2 (No such file or directory)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Error>: CoreLocation: could not chown /var/mobile/Library/Preferences/com.apple.CoreMotion.plist errno 2 (No such file or directory)
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:53 Bharath DTMobileIS[10423] <Warning>: -[UIAutomationService _startUpAgent]: posix_spawn(): Resource temporarily unavailable
debug: [IOS_SYSLOG_ROW ] Aug 14 09:36:54 Bharath npuzzle[10424] <Warning>: The operation couldn’t be completed. Banner view is visible but does not have content
debug: [IOS_SYSLOG_ROW ] Aug 14 09:37:10 Bharath lockdownd[52] <Notice>: 00281000 _select_socket: receive secure message timeout!
debug: [IOS_SYSLOG_ROW ] Aug 14 09:37:10 Bharath lockdownd[52] <Notice>: 00281000 _receive_message: walk away - non-SSL 1

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

debug: Appium request initiated at /wd/hub/status

info: <-- GET /wd/hub/status 200 2.278 ms - 155 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"c8bdf0b6-ee57-47ce-ac74-da6ef6d01a27"}

debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"c8bdf0b6-ee57-47ce-ac74-da6ef6d01a27"}

最佳答案

您正在获取日志:

"Real device specified but no ipa or app path, assuming bundle ID is on device"

当我尝试在没有应用程序路径的情况下运行检查器时,出现错误:

...running with an application opened by using the "App Path" parameter in Appium.app ...or by connecting with selenium client and supplying this in the desired capabilities object.

试试这个:

  • Archive a build in Xcode, then copy the .app file that's generated into a relevant directory.
  • Copy the path of the .app file into the 'app path' configuration.
  • Run It

关于ios - 真实设备上的 Appium 检查器 - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25303147/

相关文章:

xcode - XCTestCase 未在 setUp 类方法中启动应用程序

java - appium 中的 NoSuchMethodError

ios - 音频录制和播放同时进行

android - 在React Native中调用导出的方法

javascript - 如何使用 JavaScript 访问 UI 自动化中的操作表(及其按钮)?

c# - appium 启动有什么问题,我的程序在尝试连接到 appium 服务器时超时结束?

java - 错误 - 在 Spring Boot 项目中安装 Appium - Maven 依赖关系中断

ios - 如何减小自定义 iOS 框架的大小?

ios - 在 Swift 中以编程方式创建 UITextView 时未获得输出

ios - 为什么 UIAElement 的 child 不等于自己?