appcrawler 运行时报错,具体详见报错日志内容

此文本将被隐藏执行命令:java -jar appcrawler.jar --capability "appPackage=com.xueqiu.android
日志内容如下:

java -jar appcrawler.jar --capability "appPackage=com.xueqiu.android, appActivity=.main.view.MainActivity"
2022-05-11 18:46:23 INFO [AppCrawler$.68.main]
-------------------------------------------------
appcrawler v2.7.4 全平台自动遍历测试工具
Q&A: https://ceshiren.com/c/opensource/appcrawler
author: 思寒_seveniruby 天马 霍格沃兹测试开发学社
-------------------------------------------------

2022-05-11 18:46:23 INFO [AppCrawler$.211.parseParams] use default appium address 4723
2022-05-11 18:46:23 INFO [AppCrawler$.326.addLogFile]
-------------------------------------------------
appcrawler v2.7.4 全平台自动遍历测试工具
Q&A: https://ceshiren.com/c/opensource/appcrawler
author: 思寒_seveniruby 天马 霍格沃兹测试开发学社
-------------------------------------------------

2022-05-11 18:46:23 INFO [AppCrawler$.329.addLogFile] result directory = 20220511184622_com.xueqiu.android
2022-05-11 18:46:23 INFO [Crawler.126.start] set xpath attribute with List(name(), name, label, value, resource-id, content-desc, text, id, name, innerText, tag, class)
2022-05-11 18:46:23 INFO [Crawler.130.start] set tag attribute with List(name(), name, label, resource-id, content-desc, id, name, tag, class)
2022-05-11 18:46:23 INFO [Crawler.100.$anonfun$loadPlugins$3] com.ceshiren.appcrawler.plugin.TagLimitPlugin@f73dcd6
2022-05-11 18:46:23 INFO [Crawler.100.$anonfun$loadPlugins$3] com.ceshiren.appcrawler.plugin.ReportPlugin@5c87bfe2
2022-05-11 18:46:23 INFO [Crawler.100.$anonfun$loadPlugins$3] com.ceshiren.appcrawler.plugin.FreeMind@2fea7088
2022-05-11 18:46:23 INFO [Plugin.22.init] com.ceshiren.appcrawler.plugin.TagLimitPlugin init
2022-05-11 18:46:23 INFO [Plugin.22.init] com.ceshiren.appcrawler.plugin.ReportPlugin init
2022-05-11 18:46:23 INFO [Plugin.22.init] com.ceshiren.appcrawler.plugin.FreeMind init
2022-05-11 18:46:23 INFO [ReportFactory$.33.initReportPath] reportPath=F:\project\appcrawler\20220511184622_com.xueqiu.android
2022-05-11 18:46:23 INFO [ReportFactory$.35.initReportPath] testcaseDir=F:\project\appcrawler\20220511184622_com.xueqiu.android/tmp/
2022-05-11 18:46:23 INFO [ReportFactory$.38.initReportPath] create F:\project\appcrawler\20220511184622_com.xueqiu.android\tmp directory
2022-05-11 18:46:23 INFO [Crawler.137.start] prepare setup Appium
2022-05-11 18:46:23 INFO [Crawler.299.setupCrawler] afterAllMax=2
2022-05-11 18:46:24 INFO [Crawler.308.setupDriver]
2022-05-11 18:46:24 INFO [Crawler.344.setupDriver] use AppiumClient
2022-05-11 18:46:24 INFO [AppiumClient.45.<init>] Capabilities { appActivity: .main.view.MainActivity, app: , appActivity: .ApiDemos, appPackage: com.xueqiu.android, appium: http://127.0.0.1:4723/wd/hub, de
viceName: demo, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: true}
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error o
ccurred while processing the command. Original error: Cannot start the 'com.xueqiu.android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-st
artup.md for troubleshooting. Original error: Activity name '.ApiDemos' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-0QPHQD4', ip: '172.19.80.9', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_321'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.xueqiu.android' application. Visit https://github.com/appium/appium
/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.ApiDemos' used to start the app doesn't exist or cannot be launched! Make sure it
 exists and is a launchable activity
    at getResponseForW3CError (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
    at asyncHandler (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-0QPHQD4', ip: '172.19.80.9', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_321'
Driver info: driver.version: AndroidDriver
        at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:216)
        at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:225)
        at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
        at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
        at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
        at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
        at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:363)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
        at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
        at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:89)
        at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:99)
        at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:97)
        at com.ceshiren.appcrawler.driver.AppiumClient.<init>(AppiumClient.scala:51)
        at com.ceshiren.appcrawler.core.Crawler.setupDriver(Crawler.scala:347)
        at com.ceshiren.appcrawler.core.Crawler.setupCrawler(Crawler.scala:301)
        at com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:138)
        at com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:319)
        at com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:286)
        at com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:73)
        at com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:193)
        ... 21 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.xueqiu.android' application. Visit https://github
.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.ApiDemos' used to start the app doesn't exist or cannot be laun
ched! Make sure it exists and is a launchable activity
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-0QPHQD4', ip: '172.19.80.9', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_321'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.xueqiu.android' application. Visit https://github.com/appium/appium
/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.ApiDemos' used to start the app doesn't exist or cannot be launched! Make sure it
 exists and is a launchable activity
    at getResponseForW3CError (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
    at asyncHandler (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37)
    at process._tickCallback (internal/process/next_tick.js:68:7)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
        at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
        at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
        at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
        at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
        ... 26 more


appium 中的日志内容如下:

[Appium] Welcome to Appium v1.15.1
[Appium] Non-default server args:
[Appium]   allowInsecure: {
[Appium]   }
[Appium]   denyInsecure: {
[Appium]   }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","noReset":"true","dontStopAppOnReset":"false","newCommandTimeout":120,"platformName":"Android","deviceName":"demo","fullReset":"false"},"capabilities":{"firstMatch":[{" appActivity":".main.view.MainActivity","appium:app":"","appium:appActivity":".ApiDemos","appium:appPackage":"com.xueqiu.android","appium":"http://127.0.0.1:4723/wd/hub","appium:deviceName":"demo","appium:dontStopAppOnReset":"false","appium:fullReset":"false","appium:newCommandTimeout":120,"appium:noReset":"true","platformName":"android"}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{"app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","noReset":"true","dontStopAppOnReset":"false","newCommandTimeout":120,"platformName":"Android","deviceName":"demo","fullReset":"false"},null,{"firstMatch":[{" appActivity":".main.view.MainActivity","appium:app":"","appium:appActivity":".ApiDemos","appium:appPackage":"com.xueqiu.android","appium":"http://127.0.0.1:4723/wd/hub","appium:deviceName":"demo","appium:dontStopAppOnReset":"false","appium:fullReset":"false","appium:newCommandTimeout":120,"appium:noReset":"true","platformName":"android"}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1652267121340 (19:05:21 GMT+0800 (中国标准时间))
[BaseDriver] The capabilities [" appActivity","appium"] are not standard capabilities and should have an extension prefix
[Appium] 
[Appium] ======================================================================
[Appium]   DEPRECATION WARNING:
[Appium] 
[Appium]   The 'automationName' capability was not provided in the desired 
[Appium]   capabilities for this Android session
[Appium] 
[Appium]   Setting 'automationName=UiAutomator2' by default and using the 
[Appium]   UiAutomator2 Driver
[Appium] 
[Appium]   The next major version of Appium (2.x) will **require** the 
[Appium]   'automationName' capability to be set for all sessions on all 
[Appium]   platforms
[Appium] 
[Appium]   In previous versions (Appium <= 1.13.x), the default was 
[Appium]   'automationName=UiAutomator1'
[Appium] 
[Appium]   If you wish to use that automation instead of UiAutomator2, please 
[Appium]   add 'automationName=UiAutomator1' to your desired capabilities
[Appium] 
[Appium]   For more information about drivers, please visit 
[Appium]   http://appium.io/docs/en/about-appium/intro/ and explore the 
[Appium]   'Drivers' menu
[Appium] 
[Appium] ======================================================================
[Appium] 
[Appium] Appium v1.15.1 creating new AndroidUiautomator2Driver (v1.37.2) session
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver]   "alwaysMatch": {
[BaseDriver]     "appium: appActivity": ".main.view.MainActivity",
[BaseDriver]     "appium:appium": "http://127.0.0.1:4723/wd/hub",
[BaseDriver]     "platformName": "android",
[BaseDriver]     "appium:app": "",
[BaseDriver]     "appium:appActivity": ".ApiDemos",
[BaseDriver]     "appium:appPackage": "com.xueqiu.android",
[BaseDriver]     "appium:deviceName": "demo",
[BaseDriver]     "appium:dontStopAppOnReset": "false",
[BaseDriver]     "appium:fullReset": "false",
[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] Capability 'fullReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'dontStopAppOnReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]    appActivity
[BaseDriver]   appium
[BaseDriver] Session created with session id: 9d417c84-409a-491e-a36f-7a06c71b5752
[UiAutomator2] Starting 'com.xueqiu.android' directly on the device
[ADB] Found 1 'build-tools' folders under 'C:\Users\Administrator\AppData\Local\Android\Sdk' (newest first):
[ADB]     C:/Users/Administrator/AppData/Local/Android/Sdk/build-tools/29.0.3
[ADB] Using 'adb.exe' from 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[ADB] Setting device id to emulator-5554
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 25
[ADB] Device API level: 25
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\platform-tools\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\emulator\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\tools\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\tools\\bin\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\build-tools\\29.0.3\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'C:\Users\Administrator\AppData\Local\Android\Sdk'?
[ADB] Using 'aapt.exe' from 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\29.0.3\aapt.exe'
[ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.2' >= '2.14.2')
[ADB] There is no need to install/upgrade 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep \^appium\\.settings\$'
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell appops set io.appium.settings android\:mock_location allow'
[Logcat] Starting logcat capture
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] 'io.appium.uiautomator2.server' is installed
[ADB] Getting package info for 'io.appium.uiautomator2.server'
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\platform-tools\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\emulator\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\tools\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\tools\\bin\\apkanalyzer.bat","C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\build-tools\\29.0.3\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'C:\Users\Administrator\AppData\Local\Android\Sdk'?
[ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.3.0' >= '4.3.0')
[UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk
[ADB] Using 'apksigner.bat' from 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat'
[ADB] Starting 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v4.3.0.apk"]'
[ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[ADB] 
[ADB] 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already signed.
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[ADB] 'io.appium.uiautomator2.server.test' is installed
[ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[ADB] Starting 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk"]'
[ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[ADB] 
[ADB] 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed.
[UiAutomator2] Server packages are not going to be (re)installed
[UiAutomator2] Waiting up to 30000ms for services to be available
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation'
[UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp\:8200 tcp\:6790'
[UiAutomator2] No app capability. Assuming it is already on the device
[UiAutomator2] Performing shallow cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (Error: socket hang up)
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[UiAutomator2] Starting UIAutomator2 server 4.3.0
[UiAutomator2] Using UIAutomator2 server from 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' and test from 'C:\Users\Administrator\AppData\Local\Programs\Appium\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","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got response with status 200: {"sessionId":"None","value":{"ready":true,"message":"UiAutomator2 Server is ready to accept commands"}}
[UiAutomator2] The initialization of the instrumentation process took 2033ms
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8200/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android","deviceName":"demo","dontStopAppOnReset":false,"fullReset":false,"newCommandTimeout":120,"noReset":true},"platformName":"android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android","deviceName":"emulator-5554","dontStopAppOnReset":false,"fullReset":false,"newCommandTimeout":120,"noReset":true,"deviceUDID":"emulator-5554"}],"alwaysMatch":{}}}
[WD Proxy] Got response with status 200: {"sessionId":"8104f352-c436-4e31-b45a-0bc95231d28a","value":{"sessionId":"8104f352-c436-4e31-b45a-0bc95231d28a","capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android","deviceName":"demo","dontStopAppOnReset":false,"fullReset":false,"newCommandTimeout":120,"noReset":true},"platformName":"android"," appActivity":".main.view.MainActivity","appium":"http://127.0.0.1:4723/wd/hub","app":"","appActivity":".ApiDemos","appPackage":"com.xueqiu.android","deviceName":"emulator-5554","dontStopAppOnReset":false,"fullReset":false,"newCommandTimeout":120,"noReset":true,"deviceUDID":"emulator-5554"}],"alwaysMatch":{}}}}
[WD Proxy] Determined the downstream protocol as 'W3C'
[WD Proxy] Proxying [GET /appium/device/info] to [GET http://localhost:8200/wd/hub/session/8104f352-c436-4e31-b45a-0bc95231d28a/appium/device/info] with no body
[WD Proxy] Got response with status 200: {"sessionId":"8104f352-c436-4e31-b45a-0bc95231d28a","value":{"androidId":"e4c5f6b076de23c3","manufacturer":"nubia","model":"NX627J","brand":"nubia","apiVersion":"25","platformVersion":"7.1.2","carrierName":"CHINA MOBILE","realDisplaySize":"1080x1920","displayDensity":480,"networks":[{"type":1,"typeName":"WIFI","subtype":0,"subtypeName":"","isConnected":true,"detailedState":"CONNECTED","state":"CONNECTED","extraInfo":"\"wireless\"","isAvailable":true,"isFailover":false,"isRoaming":false,"capabilities":{"transportTypes":"NET_CAPABILITY_SUPL","networkCapabilities":"","linkUpstreamBandwidthKbps":1048576,"linkDownBandwidthKbps":1048576,"signalStrength":-2147483648,"networkSpecifier":null,"SSID":null}}],"locale":"zh_CN","timeZone":"Asia\/Shanghai"}}
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'com.xueqiu.android/.ApiDemos and waiting for 'com.xueqiu.android/.ApiDemos'
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.xueqiu.android/.ApiDemos -S'
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[WD Proxy] Matched '/' to command name 'deleteSession'
[WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/8104f352-c436-4e31-b45a-0bc95231d28a] with no body
[WD Proxy] Got response with status 200: {"sessionId":"8104f352-c436-4e31-b45a-0bc95231d28a","value":null}
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.xueqiu.android'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8200 
[ADB] Running 'C:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200'
[BaseDriver] Event 'newSessionStarted' logged at 1652267127442 (19:05:27 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: Cannot start the 'com.xueqiu.android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.ApiDemos' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[W3C]     at ADB.startApp (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:153:11)
[HTTP] <-- POST /wd/hub/session 500 6125 ms - 1360
[HTTP] 
[Instrumentation] .
[Instrumentation] Time: 3.009
[Instrumentation] 
[Instrumentation] OK (1 test)
[Instrumentation] The process has exited with code 0

启动用的activity不对 导致无法正常启动被测app

但是通过以下命令是可以正常启动雪球的,

我的这句快速启动的命令,应该跟教程的命令一致

java -jar appcrawler.jar --capability "appPackage=com.xueqiu.android, appActivity=.main.view.MainActivity"
adb shell am start -W -n com.xueqiu.android/.main.view.MainActivity -S
Stopping: com.xueqiu.android
Starting: Intent { cmp=com.xueqiu.android/.main.view.MainActivity }
Status: ok
Activity: com.xueqiu.android/.main.view.MainActivity
ThisTime: 2247
TotalTime: 2247
WaitTime: 2259
Complete

换成跟教程一致的命令,使用欢迎页的activity:
java -jar appcrawler.jar --capability "appPackage=com.xueqiu.android, appActivity=.view.WelcomeActivityAlias"
也是同样的报错

在社区里查了资料,换了旧版本的 appcrawler,成功了

如果是这样的话 看起来是命令行中的activity没有传递过去

关闭