最近搞定了吗?你用的啥版本?
请假回老家祭祖,好好拜了拜,今天上班理了下思路,准备大搞一下!
卸载已经装好的 appium-desktop,重新下载了一个安装好;
重点来了,没有按之前的思路,先打开 WebDriverAgent.xcodeproj 在 Xcode 里面 Test 通过;
直接打开 Appium Inspector,用之前的手机信息连接 iPhone 手机,直接就连上了。
我。。。
所以是我之前做的太多了?用用再看看有没有其他问题吧
结束!
我把目前详细的日志放上来,这是在 appium server gui 里面的:
The server is running
[Appium] Welcome to Appium v1.22.2
[Appium] Non-default server args:
[Appium] relaxedSecurityEnabled: true
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/sessions
[HTTP] {}
[GENERIC] Calling AppiumDriver.getSessions() with args: []
[GENERIC] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 304 4 ms - -
[HTTP]
[HTTP] --> GET /wd/hub/sessions
[HTTP] {}
[GENERIC] Calling AppiumDriver.getSessions() with args: []
[GENERIC] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 304 1 ms - -
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"appium:udid":"00008030-001505490213802E","platformName":"iOS","appium:deviceName":"iphonex","appium:bundleId":"com.tencent.live4iphone","appium:platformVersion":"16.3.1","appium:xcodeOrgId":"YY68N7Z46L","appium:xcodeSigningId":"iPhone Developer","appium:noReset":true,"appium:includeSafariInWebviews":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"appium:udid":"00008030-001505490213802E","platformName":"iOS","appium:deviceName":"iphonex","appium:bundleId":"com.tencent.live4iphone","appium:platformVersion":"16.3.1","appium:xcodeOrgId":"YY68N7Z46L","appium:xcodeSigningId":"iPhone Developer","appium:noReset":true,"appium:includeSafariInWebviews":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}}
[W3C] Calling AppiumDriver.createSession() with args: [{"appium:udid":"00008030-001505490213802E","platformName":"iOS","appium:deviceName":"iphonex","appium:bundleId":"com.tencent.live4iphone","appium:platformVersion":"16.3.1","appium:xcodeOrgId":"YY68N7Z46L","appium:xcodeSigningId":"iPhone Developer","appium:noReset":true,"appium:includeSafariInWebviews":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"appium:udid":"00008030-001505490213802E","platformName":"iOS","appium:deviceName":"iphonex","appium:bundleId":"com.tencent.live4iphone","appium:platformVersion":"16.3.1","appium:xcodeOrgId":"YY68N7Z46L","appium:xcodeSigningId":"iPhone Developer","appium:noReset":true,"appium:includeSafariInWebviews":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1679563764126 (17:29:24 GMT+0800 (中国标准时间))
[Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for iOS sessions.
[Appium] Requested iOS support with version >= 10, using 'XCUITest' driver instead of UIAutomation-based driver, since the latter is unsupported on iOS 10 and up.
[Appium] /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/index.js:1
[Appium] import * as dependencies from './lib/check-dependencies';
[Appium] ^
[Appium]
[Appium] SyntaxError: Cannot use import statement outside a module
[Appium] at Module._compile (internal/modules/cjs/loader.js:815:22)
[Appium] at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
[Appium] at Module.load (internal/modules/cjs/loader.js:735:32)
[Appium] at Module._load (internal/modules/cjs/loader.js:648:12)
[Appium] at Module._load (electron/js2c/asar.js:717:26)
[Appium] at Function.Module._load (electron/js2c/asar.js:717:26)
[Appium] at Module.require (internal/modules/cjs/loader.js:775:19)
[Appium] at require (internal/modules/cjs/helpers.js:68:18)
[Appium] at Object. (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:5:1)
[Appium] at Module._compile (internal/modules/cjs/loader.js:880:30)
[Appium] at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
[Appium] at Module.load (internal/modules/cjs/loader.js:735:32)
[Appium] at Module._load (internal/modules/cjs/loader.js:648:12)
[Appium] at Module._load (electron/js2c/asar.js:717:26)
[Appium] at Function.Module._load (electron/js2c/asar.js:717:26)
[Appium] at Module.require (internal/modules/cjs/loader.js:775:19)
[Appium] at require (internal/modules/cjs/helpers.js:68:18)
[Appium] at Object. (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/index.js:4:1)
[Appium] at Module._compile (internal/modules/cjs/loader.js:880:30)
[Appium] at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
[Appium] at Module.load (internal/modules/cjs/loader.js:735:32)
[Appium] at Module._load (internal/modules/cjs/loader.js:648:12)
[Appium] at Module._load (electron/js2c/asar.js:717:26)
[Appium] at Function.Module._load (electron/js2c/asar.js:717:26)
[Appium] at Module.require (internal/modules/cjs/loader.js:775:19)
[Appium] at require (internal/modules/cjs/helpers.js:68:18)
[Appium] at AppiumDriver.getDriverAndVersionForCaps (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:252:24)
[Appium] at AppiumDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:340:66)
[BaseDriver] Event 'newSessionStarted' logged at 1679563764188 (17:29:24 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: Could not load a driver for platformName 'iOS'. Please verify your Appium installation
[W3C] at AppiumDriver.getDriverAndVersionForCaps (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:268:11)
[W3C] at AppiumDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:340:66)
[W3C] at commandExecutor (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:335:9)
[W3C] at AppiumDriver.executeCommand (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:349:15)
[W3C] at AppiumDriver.executeCommand (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:549:26)
[W3C] at asyncHandler (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:297:34)
[W3C] at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:423:15
[W3C] at Layer.handle as handle_request
[W3C] at next (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:137:13)
[W3C] at Route.dispatch (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:112:3)
[W3C] at Layer.handle as handle_request
[W3C] at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:281:22
[W3C] at Function.process_params (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[W3C] at next (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[W3C] at logger (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/morgan/index.js:144:5)
[W3C] at Layer.handle as handle_request
[W3C] at trim_prefix (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:317:13)
[W3C] at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:284:7
[W3C] at Function.process_params (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[W3C] at next (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[W3C] at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/body-parser/lib/read.js:130:5
[W3C] at invokeCallback (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:224:16)
[W3C] at done (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:213:7)
[W3C] at IncomingMessage.onEnd (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:273:7)
[W3C] at IncomingMessage.emit (events.js:208:15)
[W3C] at endReadableNT (_stream_readable.js:1168:12)
[W3C] at processTicksAndRejections (internal/process/task_queues.js:77:11)
[HTTP] <-- POST /wd/hub/session 500 88 ms - 757
[HTTP]
/Applications/Xcode14.3beta3.app/Contents/Developer/usr/bin/xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=00008030-001505490213802E' test
用这个命令试了下,开始是报错 ‘WebDriverAgent.xcodeproj’ 找不到,拷贝了一份 appium-webdriveragent 到/usr/local/lib/node_modules/appium/node_modules/下面,
在 Xcode Test 了一下可以往 iOS 安装 WebDriverAgent;继续执行命令,当前的报错:
Testing failed:
No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "YY68N7Z46L" with a private key was found.
No profiles for 'com.xdpi.webdrive.xctrunner' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xdpi.webdrive.xctrunner'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Testing cancelled because the build failed.
** TEST FAILED **
appium-doctor 诊断看起来也不去缺啥。
sh-3.2# appium-doctor --ios
WARN AppiumDoctor [Deprecated] Please use appium-doctor installed with "npm install @appium/doctor --location=global"
info AppiumDoctor Appium Doctor v.1.16.2
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 18.15.0
info AppiumDoctor Xcode is installed at: /Applications/Xcode14.3beta3.app/Contents/Developer
info AppiumDoctor Xcode Command Line Tools are installed in: /Applications/Xcode14.3beta3.app/Contents/Developer
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.35.0
info AppiumDoctor HOME is set to: /var/root
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor ✖ opencv4nodejs cannot be found.
WARN AppiumDoctor ✖ ffmpeg cannot be found
WARN AppiumDoctor ✖ mjpeg-consumer cannot be found.
WARN AppiumDoctor ✖ set-simulator-location is not installed
WARN AppiumDoctor ✖ idb and idb_companion are not installed
WARN AppiumDoctor ✖ applesimutils cannot be found
info AppiumDoctor ios-deploy is installed at: /usr/local/bin/ios-deploy. Installed version is: 1.12.1
info AppiumDoctor ### Diagnostic for optional dependencies completed, 6 fixes possible. ###
info AppiumDoctor
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: http://appium.io/docs/en/writing-running-appium/image-comparison/
WARN AppiumDoctor ➜ ffmpeg is needed to record screen features. Please read https://www.ffmpeg.org/ to install it
WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.
WARN AppiumDoctor ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it
WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb
WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/
info AppiumDoctor
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
android 没有问题的。
😓 谢谢!改了,明天看结果。
@ 陈恒捷 @Eason
试着在起 appium 的时候加了 --uuid
终端 1
node /Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js -a 0.0.0.0 -p 4623 --bootstrap-port 4624 -U 127.0.0.1:62001 --udid RFCN30WZCZB
[ start_appium ]: start appium ok ,appium_id = 45145
! ! ! appium_id : 45145
error: more than one device/emulator
[ check_app_installed ]: check start
[ check_app_installed ]: appPackage = com.sankuai.meituan appactivity= com.meituan.android.pt.homepage.activity.MainActivity
[ connect_android_app ]: start remote appiumurl = http://localhost:4623/wd/hub
[ connect_android_app ]: connect success
[ check_app_installed ]: check end!
adb: more than one device/emulator
终端 2 Failed
node /Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js -a 0.0.0.0 -p 4633 --bootstrap-port 4634 --uuid e6386478
[ start_appium ]: start appium ok ,appium_id = 44976
[ check_app_installed ]: check start
[ check_app_installed ]: appPackage = com.tencent.mm appactivity= com.tencent.mm.ui.LauncherUI
[ connect_android_app ]: start remote appiumurl = http://localhost:4633/wd/hub
[ connect_android_app ] connect exception
HTTPConnectionPool(host='localhost', port=4633): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
@ 陈恒捷 @Eason 这个是出现问题的时候信息,就是在操作过程中,会突然出错
Try :find element and then click accessibility_id : MI170
SUCCESS :find element and then click accessibility_id : MI170
Try :find element and then click id : com.immomo.momo:id/message_btn_selectpic
[ ERROR ] find element and then click failed! id : com.immomo.momo:id/message_btn_selectpic
HTTPConnectionPool(host='127.0.0.1', port=4633): Max retries exceeded with url: /wd/hub/session/5680072f-55b5-43b6-971b-f3698a212d0f/timeouts (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
我用 appium1.15.1 ,iOS 特别不稳定,经常连不上,要不停尝试。。。
不知道杀原因。