android-emulator-runner
android-emulator-runner copied to clipboard
[ADB] cmd: Can't find service: settings [ADB] cmd: Can't find service: settings'; Code: '20'
I'm trying to run an automation test using Appium but I'm getting the following error below, knowing that the emulator status shown booted is completed.
[UiAutomator2] Unable to force stop app: Error executing adbExec. Original error: 'Command '/Users/runner/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.test.app' exited with code 20'; Stderr: 'cmd: Can't find service: activity'; Code: '20'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/runner/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[ADB] Failed to delete keys 'hidden_api_policy_pre_p_apps,hidden_api_policy_p_apps,hidden_api_policy'. Original error: Error executing adbExec. Original error: 'Command '/Users/runner/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' exited with code 20'; Stderr: 'cmd: Can't find service: settings
[ADB] cmd: Can't find service: settings
[ADB] cmd: Can't find service: settings'; Code: '20'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1628767192789 (11:19:52 GMT+0000 (Coordinated Universal Time))
[debug] [W3C] Encountered internal error running command: Error executing adbExec. Original error: 'Command '/Users/runner/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install -g /Users/runner/hostedtoolcache/node/14.17.4/x64/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk' exited with code 1'; Stderr: 'adb: failed to install /Users/runner/hostedtoolcache/node/14.17.4/x64/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk: cmd: Can't find service: package'; Code: '1'
[debug] [W3C] Error: Command '/Users/runner/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install -g /Users/runner/hostedtoolcache/node/14.17.4/x64/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk' exited with code 1
[debug] [W3C] at ChildProcess.<anonymous> (/Users/runner/hostedtoolcache/node/14.17.4/x64/lib/node_modules/appium/node_modules/teen_process/lib/exec.js:113:19)
[debug] [W3C] at ChildProcess.emit (events.js:400:28)
[debug] [W3C] at maybeClose (internal/child_process.js:1055:16)
[debug] [W3C] at Socket.<anonymous> (internal/child_process.js:441:11)
[debug] [W3C] at Socket.emit (events.js:400:28)
[debug] [W3C] at Pipe.<anonymous> (net.js:675:12)
can you share your workflow? have you tried with some lower API levels?
Hi @amrsa1! Did you ever manage to solve this?
This is likely because you are using the wrong flavor of system image. Closing because stale, but for anyone in the future seeing this, try using google_apis or playstore variant.