appium老是报这样的错:Appium Settings app is not running after 5000ms,求助大家怎么解决

appium日志

[Appium]

[Appium] Appium v1.19.1 creating new AndroidUiautomator2Driver (v1.59.0) 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] Creating session with W3C capabilities: {

[BaseDriver] “alwaysMatch”: {

[BaseDriver] “platformName”: “Android”,

[BaseDriver] “appium:newCommandTimeout”: “3600”,

[BaseDriver] “appium:appPackage”: “com.android.browser”,

[BaseDriver] “appium:appActivity”: “com.android.browser.BrowserActivity”,

[BaseDriver] “appium:udid”: “2b4435e5”,

[BaseDriver] “appium:noReset”: true,

[BaseDriver] “appium:autoAcceptAlerts”: true,

[BaseDriver] “appium:adbPort”: “10001”

[BaseDriver] },

[BaseDriver] “firstMatch”: [

[BaseDriver] {}

[BaseDriver] ]

[BaseDriver] }

[BaseDriver] Number capability passed in as string. Functionality may be compromised.

[BaseDriver] Number capability passed in as string. Functionality may be compromised.

[BaseDriver] Capability ‘newCommandTimeout’ changed from string (‘3600’) to integer (3600). This may cause unexpected behavior

[BaseDriver] Capability ‘adbPort’ changed from string (‘10001’) to integer (10001). This may cause unexpected behavior

[BaseDriver] The following capabilities were provided, but are not recognized by Appium:

[BaseDriver] autoAcceptAlerts

[BaseDriver] Session created with session id: 1fc87a8e-3a5d-4fbb-8976-8736c9b7116d

[UiAutomator2] Starting ‘com.android.browser’ directly on the device

[ADB] Using ‘adb.exe’ from ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe’

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 start-server’

[AndroidDriver] Retrieving device list

[ADB] Trying to find a connected android device

[ADB] Getting connected devices

[ADB] Connected devices: [{“udid”:“2b4435e5”,“state”:“device”}]

[AndroidDriver] Using device: 2b4435e5

[ADB] Using ‘adb.exe’ from ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe’

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 start-server’

[ADB] Setting device id to 2b4435e5

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell getprop ro.build.version.sdk’

[ADB] Current device property ‘ro.build.version.sdk’: 29

[ADB] Getting device platform version

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell getprop ro.build.version.release’

[ADB] Current device property ‘ro.build.version.release’: 10

[ADB] Device API level: 29

[UiAutomator2] Relaxing hidden api policy

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell ‘settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1’’

[AndroidDriver] No app sent in, not parsing package/activity

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 wait-for-device’

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell echo ping’

[AndroidDriver] Pushing settings apk to device…

[ADB] Getting install status for io.appium.settings

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell dumpsys package io.appium.settings’

[ADB] ‘io.appium.settings’ is installed

[ADB] Getting package info for ‘io.appium.settings’

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell dumpsys package io.appium.settings’

[ADB] The version name of the installed ‘io.appium.settings’ is greater or equal to the application version name (‘3.2.1’ >= ‘3.2.1’)

[ADB] There is no need to install/upgrade ‘D:\Appium-windows-1.19.1\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 ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell ‘pgrep --help; echo $?’’

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Starting Appium Settings app

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[ADB] Getting IDs of all ‘io.appium.settings’ processes

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’

[AndroidDriver] Error: Appium Settings app is not running after 5000ms

[AndroidDriver] at ADB.requireRunningSettingsApp (D:\Appium-windows-1.19.1\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\settings-client-commands.js:70:11)

[UiAutomator2] Deleting UiAutomator2 session

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 shell am force-stop com.android.browser’

[UiAutomator2] Restoring hidden api policy to the device default configuration

[ADB] Running ‘D:\Program Files (x86)\android-sdk\platform-tools\adb.exe -P 10001 -s 2b4435e5 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 1667031559488 (16:19:19 GMT+0800 (中国标准时间))

[W3C] Encountered internal error running command: Error: Appium Settings app is not running after 5000ms

[W3C] at ADB.requireRunningSettingsApp (D:\Appium-windows-1.19.1\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\settings-client-commands.js:70:11)

[W3C] Destroying socket connection

[HTTP] ← POST /wd/hub/session 500 7773 ms - 659

[HTTP]
下面是我的python代码

desired_caps = {
        'newCommandTimeout': "3600",
        'platformName': "Android",
        # 'deviceName': data['deviceName'],
        # 'platformVersion': data['platformVersion'],
        'appPackage': "com.android.browser",
        'appActivity': "com.android.browser.BrowserActivity",
        'udid': "2b4435e5",
        'noReset': True,
        # 'systemPort': data['systemPort'],
        'autoAcceptAlerts': True,
        #指定adb端口
        'adbPort': "10001",
        # 'ignoreHiddenApiPolicyError':True
    }
driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
time.sleep(10)
driver.quit()

从报错看 是appium启动环境中的io.appium.settings没有能够启动成功,尝试把手机中已经安装的这个app卸载掉让appium启动的时候重新安装一下试试看呢?

已经尝试很多次了,还是不行,也手动安装了io.appium.settings,但是都不行

在命令行执行一下这个语句 手动启动一下看看呢

D:\Program Files (x86)\android-sdk\platform-tools>adb.exe -P 10001 -s 2b4435e5 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=io.appium.settings/.Settings }
显示这个结果,是启动成功了吗?

appium setting 打开然后就退出了

adb uninstall io.appium.settings
adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test
adb uninstall io.appium.unlock

执行下这些,再跑一次试试呢?

还是不行,一样的报错,只装了io.appium.settings这个包,后面的包都还没有安装

我的真机和模拟器都报一样的错,应该问题就在我的电脑上

appium换个版本试试,1.21以上的试一下

有这个版本吗?我现在就是1.22.3

换成了1.18.0这个老版本就没有问题了 :sweat_smile:太坑了,搞了2天[ quote=“xiaoyu0407, post:11, topic:22924, full:true”]
有这个版本吗?我现在就是1.22.3

关闭