我已经通过端口5555上的tcpip无线连接了android设备。当我运行命令“adb devices”时,我得到以下输出
附加的设备列表
现在,我使用以下功能在同一设备上运行appium测试用例
“AppPackage”:“com.***.”,
“UIAutomator2ServerInstallTimeout”:“500000”,
"DeviceName":"172.16.202.156:5555",
“AppActivity”:“*********.SplashActivity”,
“AndroidInstallTimeout”:“500000”,
“NativeInstrumentSlib”:“true”,
“NewCommandTimeout”:“500”,
“AdbExectionMeout”:“520000”,
"BrowserName":"",
"WaitForAppScript":"$.delay(5000);",
“PlatformName”:“Android”,
我在appium服务器日志中得到了adb命令的错误。
[debug][35m[MJSONWP][39m运行命令时遇到内部错误:错误:获取设备平台版本时出错。原始错误:执行adbexec时出错。原始错误:“command”/users/mac1/library/android/sdk/platform-tools/adb-p 5037-s 172.16.202.156:5555 shell getprop ro.build.version.release“退出,代码为1”;stderr:“错误:未知主机服务”;代码:“1”[debug][35m[MJSONWP][39m位于adb.getplatformversion(
下面是完整的appium服务器日志。
[info] [35m[Appium][39m Welcome to Appium v1.17.1
[info] [35m[Appium][39m Non-default server args:
[info] [35m[Appium][39m allowInsecure: {
[info] [35m[Appium][39m }
[info] [35m[Appium][39m denyInsecure: {
[info] [35m[Appium][39m }
[info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/status[39m
[info] [35m[HTTP][39m [90m{}[39m
[debug] [35m[GENERIC][39m Calling AppiumDriver.getStatus() with args: []
[debug] [35m[GENERIC][39m Responding to client with driver.getStatus() result: {"build":{"version":"1.17.1"}}
[info] [35m[HTTP][39m [37m<-- GET /wd/hub/status [39m[32m200[39m [90m9 ms - 68[39m
[info] [35m[HTTP][39m [90m[39m
[info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/status[39m
[info] [35m[HTTP][39m [90m{}[39m
[debug] [35m[GENERIC][39m Calling AppiumDriver.getStatus() with args: []
[debug] [35m[GENERIC][39m Responding to client with driver.getStatus() result: {"build":{"version":"1.17.1"}}
[info] [35m[HTTP][39m [37m<-- GET /wd/hub/status [39m[32m200[39m [90m2 ms - 68[39m
[info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{"capabilities":{"desiredCapabilities":{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}},"desiredCapabilities":{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}}[39m
[debug] [35m[W3C][39m Calling AppiumDriver.createSession() with args: [{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},{},{"desiredCapabilities":{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}}]
[debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1614153815161 (08:03:35 GMT+0000 (Coordinated Universal Time))
[info] [35m[Appium][39m Appium v1.17.1 creating new AndroidUiautomator2Driver (v1.44.2) session
[debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: {
[debug] [35m[BaseDriver][39m "appPackage": "com.********.******",
[debug] [35m[BaseDriver][39m "uiautomator2ServerInstallTimeout": "500000",
[debug] [35m[BaseDriver][39m "deviceName": "172.16.202.156:5555",
[debug] [35m[BaseDriver][39m "appActivity": "crc646c9a2553fa37f659.SplashActivity",
[debug] [35m[BaseDriver][39m "androidInstallTimeout": "500000",
[debug] [35m[BaseDriver][39m "nativeInstrumentsLib": "true",
[debug] [35m[BaseDriver][39m "newCommandTimeout": "500",
[debug] [35m[BaseDriver][39m "adbExecTimeout": "520000",
[debug] [35m[BaseDriver][39m "platformVersion": "9",
[debug] [35m[BaseDriver][39m "automationName": "UiAutomator2",
[debug] [35m[BaseDriver][39m "browserName": "",
[debug] [35m[BaseDriver][39m "waitForAppScript": "$.delay(5000);",
[debug] [35m[BaseDriver][39m "platformName": "Android",
[debug] [35m[BaseDriver][39m "autoAcceptAlerts": "true"
[debug] [35m[BaseDriver][39m }
[warn] [35m[BaseDriver][39m Capability 'newCommandTimeout' changed from string ('500') to integer (500). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'uiautomator2ServerInstallTimeout' changed from string ('500000') to integer (500000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'androidInstallTimeout' changed from string ('500000') to integer (500000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'adbExecTimeout' changed from string ('520000') to integer (520000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m The following capabilities were provided, but are not recognized by Appium:
[warn] [35m[BaseDriver][39m nativeInstrumentsLib
[warn] [35m[BaseDriver][39m waitForAppScript
[warn] [35m[BaseDriver][39m autoAcceptAlerts
[info] [35m[BaseDriver][39m Session created with session id: 8fea8be0-33b8-4fca-8d01-39121a8731ae
[info] [35m[UiAutomator2][39m Starting 'com.********.******' directly on the device[info] [35m[ADB][39m Found 2 'build-tools' folders under '/Users/mac1/Library/Android/sdk' (newest first):
[info] [35m[ADB][39m /Users/mac1/Library/Android/sdk/build-tools/30.0.0
[info] [35m[ADB][39m /Users/mac1/Library/Android/sdk/build-tools/28.0.3
[info] [35m[ADB][39m Using 'adb' from '/Users/mac1/Library/Android/sdk/platform-tools/adb'
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices...
[debug] [35m[ADB][39m Connected devices: [{"udid":"172.16.202.156:5555","state":"device"}]
[info] [35m[AndroidDriver][39m Looking for a device with Android '9.0.0'
[debug] [35m[ADB][39m Setting device id to 172.16.202.156:5555
[info] [35m[ADB][39m Getting device platform version
[debug] [35m[ADB][39m Running '/Users/mac1/Library/Android/sdk/platform-tools/adb -P 5037 -s 172.16.202.156\:5555 shell getprop ro.build.version.release'
[debug] [35m[UiAutomator2][39m Deleting UiAutomator2 session
[debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1614153815988 (08:03:35 GMT+0000 (Coordinated Universal Time))
[debug] [35m[MJSONWP][39m Encountered internal error running command: Error: Error getting device platform version. Original error: Error executing adbExec. Original error: 'Command '/Users/mac1/Library/Android/sdk/platform-tools/adb -P 5037 -s 172.16.202.156\:5555 shell getprop ro.build.version.release' exited with code 1'; Stderr: 'error: unknown host service'; Code: '1'
[debug] [35m[MJSONWP][39m at ADB.getPlatformVersion (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/adb-commands.js:122:11)
[debug] [35m[MJSONWP][39m Destroying socket connection
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[31m500[39m [90m893 ms - 436[39m
[info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{"desiredCapabilities":{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}}[39m
[debug] [35m[MJSONWP][39m Calling AppiumDriver.createSession() with args: [{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},{},null]
[debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1614153816119 (08:03:36 GMT+0000 (Coordinated Universal Time))
[info] [35m[Appium][39m Appium v1.17.1 creating new AndroidUiautomator2Driver (v1.44.2) session
[debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: {
[debug] [35m[BaseDriver][39m "appPackage": "com.********.******",
[debug] [35m[BaseDriver][39m "uiautomator2ServerInstallTimeout": "500000",
[debug] [35m[BaseDriver][39m "deviceName": "172.16.202.156:5555",
[debug] [35m[BaseDriver][39m "appActivity": "crc646c9a2553fa37f659.SplashActivity",
[debug] [35m[BaseDriver][39m "androidInstallTimeout": "500000",
[debug] [35m[BaseDriver][39m "nativeInstrumentsLib": "true",
[debug] [35m[BaseDriver][39m "newCommandTimeout": "500",
[debug] [35m[BaseDriver][39m "adbExecTimeout": "520000",
[debug] [35m[BaseDriver][39m "platformVersion": "9",
[debug] [35m[BaseDriver][39m "automationName": "UiAutomator2",
[debug] [35m[BaseDriver][39m "browserName": "",
[debug] [35m[BaseDriver][39m "waitForAppScript": "$.delay(5000);",
[debug] [35m[BaseDriver][39m "platformName": "Android",
[debug] [35m[BaseDriver][39m "autoAcceptAlerts": "true"
[debug] [35m[BaseDriver][39m }
[warn] [35m[BaseDriver][39m Capability 'newCommandTimeout' changed from string ('500') to integer (500). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'uiautomator2ServerInstallTimeout' changed from string ('500000') to integer (500000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'androidInstallTimeout' changed from string ('500000') to integer (500000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability 'adbExecTimeout' changed from string ('520000') to integer (520000). This may cause unexpected behavior
[warn] [35m[BaseDriver][39m The following capabilities were provided, but are not recognized by Appium:
[warn] [35m[BaseDriver][39m nativeInstrumentsLib
[warn] [35m[BaseDriver][39m waitForAppScript
[warn] [35m[BaseDriver][39m autoAcceptAlerts
[info] [35m[BaseDriver][39m Session created with session id: e854d697-1ed0-481c-b353-0f31eca49d97
[info] [35m[UiAutomator2][39m Starting 'com.********.******' directly on the device
[info] [35m[ADB][39m Using 'adb' from '/Users/mac1/Library/Android/sdk/platform-tools/adb'
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices...
[debug] [35m[ADB][39m Connected devices: [{"udid":"172.16.202.156:5555","state":"device"}]
[info] [35m[AndroidDriver][39m Looking for a device with Android '9.0.0'
[debug] [35m[ADB][39m Setting device id to 172.16.202.156:5555
[info] [35m[ADB][39m Getting device platform version
[debug] [35m[ADB][39m Running '/Users/mac1/Library/Android/sdk/platform-tools/adb -P 5037 -s 172.16.202.156\:5555 shell getprop ro.build.version.release'
[debug] [35m[UiAutomator2][39m Deleting UiAutomator2 session
[debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1614153816179 (08:03:36 GMT+0000 (Coordinated Universal Time))
[debug] [35m[MJSONWP][39m Encountered internal error running command: Error: Error getting device platform version. Original error: Error executing adbExec. Original error: 'Command '/Users/mac1/Library/Android/sdk/platform-tools/adb -P 5037 -s 172.16.202.156\:5555 shell getprop ro.build.version.release' exited with code 1'; Stderr: 'error: unknown host service'; Code: '1'
[debug] [35m[MJSONWP][39m at ADB.getPlatformVersion (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/adb-commands.js:122:11)
[debug] [35m[MJSONWP][39m Destroying socket connection
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[31m500[39m [90m63 ms - 436[39m
[info] [35m[HTTP][39m [90m[39m
[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{"capabilities":{"desiredCapabilities":{"appPackage":"com.*******.***","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}}}[39m
[debug] [35m[W3C][39m Calling AppiumDriver.createSession() with args: [null,null,{"desiredCapabilities":{"appPackage":"com.********.******","uiautomator2ServerInstallTimeout":"500000","deviceName":"172.16.202.156:5555","appActivity":"crc646c9a2553fa37f659.SplashActivity","androidInstallTimeout":"500000","nativeInstrumentsLib":"true","newCommandTimeout":"500","adbExecTimeout":"520000","platformVersion":"9","automationName":"UiAutomator2","browserName":"","waitForAppScript":"$.delay(5000);","platformName":"Android","autoAcceptAlerts":"true"},"requiredCapabilities":{}}]
[debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1614153816188 (08:03:36 GMT+0000 (Coordinated Universal Time))
[debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1614153816189 (08:03:36 GMT+0000 (Coordinated Universal Time))
[debug] [35m[W3C][39m Encountered internal error running command: Error: Either JSONWP or W3C capabilities should be provided
[debug] [35m[W3C][39m at parseCapsForInnerDriver (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/utils.js:58:14)
[debug] [35m[W3C][39m at AppiumDriver.createSession (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/appium.js:296:26)
[debug] [35m[W3C][39m at commandExecutor (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:330:9)
[debug] [35m[W3C][39m at AppiumDriver.executeCommand (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:344:15)
[debug] [35m[W3C][39m at AppiumDriver.executeCommand (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/appium.js:520:26)
[debug] [35m[W3C][39m at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:309:34)
[debug] [35m[W3C][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:15
[debug] [35m[W3C][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [35m[W3C][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:137:13)
[debug] [35m[W3C][39m at Route.dispatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:112:3)
[debug] [35m[W3C][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [35m[W3C][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:281:22
[debug] [35m[W3C][39m at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[debug] [35m[W3C][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[debug] [35m[W3C][39m at logger (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/morgan/index.js:144:5)
[debug] [35m[W3C][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [35m[W3C][39m at trim_prefix (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:317:13)
[debug] [35m[W3C][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:284:7
[debug] [35m[W3C][39m at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[debug] [35m[W3C][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[debug] [35m[W3C][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/body-parser/lib/read.js:130:5
[debug] [35m[W3C][39m at invokeCallback (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:224:16)
[debug] [35m[W3C][39m at done (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:213:7)
[debug] [35m[W3C][39m at IncomingMessage.onEnd (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:273:7)
[debug] [35m[W3C][39m at IncomingMessage.emit (events.js:208:15)
[debug] [35m[W3C][39m at endReadableNT (_stream_readable.js:1168:12)
[debug] [35m[W3C][39m at processTicksAndRejections (internal/process/task_queues.js:77:11)
[debug] [35m[W3C][39m Destroying socket connection
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[31m500[39m [90m55 ms - 667[39m
[info] [35m[HTTP][39m [90m[39m
可能是这个已知的问题:https://github.com/appium/appium/issues/12736(他们把这个问题归咎于adb
,而不是承认)。您能运行ADB shell getprop ro.build.version.release
吗?
我已使用 adb connect 通过 tcpip 连接了Android设备
我可以使用adb无线命令连接和运行一个设备,但如何添加多个设备。 在我的pc上-at命令提示符。 adb tcpip 5555 亚行连接1.1.1.1 1.1.1.1:5555设备已连接 1.1.1.1是设备的IP 对于多个设备,如何执行?
我正试图通过蓝牙将数据从一台设备传输到另一台设备。 我之前曾尝试在android网站上运行bluetoothChat示例代码,但没有成功。 现在,我继续研究我发现的这段代码,虽然它在我的设备上编译,但它们之间没有连接。 有人看到下面的代码有什么问题吗?如果有人知道android上蓝牙的一些好资源,如果他们能与我分享,我将不胜感激!
我在android studio中运行我的第一个应用程序“Hi World”时出错。我正在学习过程中,刚刚开始学习android开发。请帮忙,我将非常感谢你。这是错误代码:C:\Android\sdk1\tools\emulator。exe-netdelay none-netspeed full-avd Nexus\u 5\u API\u 23 Hax已启用 Hax ram\U尺寸0x400000
问题内容: 我创建了一个android应用,在此应用中,用户可以保存一些任务。这些任务将保存在设备中,并且当用户上线时,任务将同步到服务器。用户保存任务时,我需要知道正确的日期和时间。诸如或返回设备时间之类的代码,如果设备时间不正确,则任务会以错误的日期保存。这个应用程式必须离线运作,这一点很重要。并且由于该应用程序的冗长性,用户可能有意更改设备时间。对不起,我的英语不好。 问题答案: 因此,我最
我正在尝试使用Android的MediaCodec接口解码H.264流。在我的测试设备上,一切都运行得很好,但在一个我无法访问的客户设备(三星Tab S)上,却出现了奇怪的问题。 当我解码流时,我不发送任何SPS/PPS、NALs或初始帧。我只是开始从现场流中推送数据,将其分割成以0x09 NAL结尾的块,解码器就会很好地同步自己,没有问题,非常快。 至少这一个设备的问题是,当我从解码器获得一个B