Android driver fails before emulator is booted
See original GitHub issueThe problem
When I use avd capability to start emulator, android driver fails even before emulator is booted up.
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'; Command output: cmd: Can't find service: settings
cmd: Can't find service: settings
cmd: Can't find service: settings
Environment
- Appium version (or git revision) that exhibits the issue: 1.22.3
- Desktop OS/version used to run Appium: MacOs 12.4
- Node.js version (unless using Appium.app|exe): 18.5
- Mobile platform/version under test: Android
- Real device or emulator/simulator: simulator
Details
Used capabilities
appiumOptions.AddAdditionalAppiumOption(MobileCapabilityType.PlatformName, "Android");
appiumOptions.AddAdditionalAppiumOption("appPackage", "appPackage");
appiumOptions.AddAdditionalAppiumOption("appActivity", "SplashScreen");
appiumOptions.AddAdditionalAppiumOption("avd", "Pixel_2_API_31");
appiumOptions.AddAdditionalAppiumOption("avdArgs", "-no-snapshot-load");
appiumOptions.AddAdditionalAppiumOption("androidInstallTimeout", 120000);
appiumOptions.AddAdditionalAppiumOption("newCommandTimeout", 120);
appiumOptions.AddAdditionalAppiumOption("acceptInsecureCerts", true);
appiumOptions.AddAdditionalAppiumOption("appWaitDuration", 60000);
appiumOptions.AddAdditionalAppiumOption("avdLaunchTimeout", 180000);
appiumOptions.AddAdditionalAppiumOption("avdReadyTimeout", 180000);
var driver = new AndroidDriver(ap, appiumOptions); // initialize Android
When AndroidDriver is instantiated, it starts android emulator, emulator starts booting, shows google logo, appium fails with error:
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'; Command output: cmd: Can't find service: settings
cmd: Can't find service: settings
cmd: Can't find service: settings
10 seconds later emulator is booted up to home screen properly. When I start emulator manually before running appium everything works just fine.
Issue Analytics
- State:
- Created a year ago
- Comments:19
Top Results From Across the Web
Emulator in Android Studio doesn't start - Stack Overflow
In my case the android hangs at start up. I solved by wiping user data and forcing a cold boot, using Android Virtual...
Read more >Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >Android Emulator Troubleshooting - Xamarin - Microsoft Learn
This article explains how to diagnose and work around problems that may occur when using the Android Emulator.
Read more >ADB shows error 'no devices/emulators found'
I have recently tried using ADB/fastboot to install the community build. I am certain I have installed the correct ADB/fastboot drivers and also...
Read more >error failed to launch emulator. reason: emulator exited before ...
check in the AVD that a particular Android OS is selected and installed for a virtual device you use (in my case it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m afraid the timeout there is hardcoded. Although I don’t see a reason it could not be increased
@StephanB75 Try uia2 driver v. 2.4.5