问一下android11版本上能跑吗,我总是跑不动,提示连接不上
[Appium] Appium v1.22.3 creating new AndroidUiautomator2Driver (v1.70.1) session
[Appium] Applying relaxed security to ‘AndroidUiautomator2Driver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “appium:appium”: “http://127.0.0.1:4723/wd/hub”,
[BaseDriver] “platformName”: “android”,
[BaseDriver] “appium:app”: “”,
[BaseDriver] “appium:appActivity”: “.activity.init.InitActivity”,
[BaseDriver] “appium:appPackage”: “com.baidu.homework”,
[BaseDriver] “appium:automationName”: “UiAutomator2”,
[BaseDriver] “appium:deviceName”: “7H17021000FES”,
[BaseDriver] “appium:dontStopAppOnReset”: true,
[BaseDriver] “appium:newCommandTimeout”: 120,
[BaseDriver] “appium:noReset”: “true”
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] Capability ‘noReset’ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] appium
[BaseDriver] Session created with session id: a05516a5-3619-4417-ba9a-7830df92337f
[UiAutomator2] Starting ‘com.baidu.homework’ directly on the device
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES shell am force-stop io.appium.uiautomator2.server.test’
[UiAutomator2] Starting UIAutomator2 server 4.27.0
[UiAutomator2] Using UIAutomator2 server from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’ and test from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[ADB] Creating ADB subprocess with args: [“-P”,5037,“-s”,“7H17021000FES”,“shell”,“am”,“instrument”,“-w”,“-e”,“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[UiAutomator2] The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of ‘uiautomator2ServerLaunchTimeout’ capability
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8201
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES forward --remove tcp:8201’
[UiAutomator2] Restoring hidden api policy to the device default configuration
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[BaseDriver] Event ‘newSessionStarted’ logged at 1677135378386 (14:56:18 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of ‘uiautomator2ServerLaunchTimeout’ capability
[W3C] at Object.errorAndThrow (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:94:35)
[W3C] at UiAutomator2Server.startSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:236:15)
[W3C] at runMicrotasks ()
[W3C] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:416:5)
[W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:229:7)
[W3C] at AppiumDriver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\lib\appium.js:387:35)
[HTTP] ← POST /wd/hub/session 500 39780 ms - 1151
[HTTP]
然后在android9的机器上就能跑
命令是这个:
java -jar appcrawler-2.7.4-hogwarts.jar -c config_baidu_homework.yaml --capability automationName=UiAutomator2
config_baidu_homework.yaml
capability:
appPackage: “com.baidu.homework”
appActivity: “.activity.init.InitActivity”
dontStopAppOnReset: true
deviceName: “7H17021000FES”
newCommandTimeout: 300
implicitlyWaitTestCase: 300
implicitlyWaitCrawl: 300
maxTime: 1800
maxDepth: 10