Settings_apk-debug.apk and unlock_apk-debug.apk fail to install

I am trying to test an Android app with Appium (version 1.5.3) and the Android emulator, but each time I run my test script, Appium is unable to install either settings_apk-debug.apk or unlock_apk-debug.apk. I have tried using the Android emulator with OS versions 4.4.2 (API level 19), 5.0 (API level 20), 5.0.1 (API level 21) and 5.1.1 (API level 22) - NONE OF THEM WORK. Below, you can see the 2 commands (from Appium logs) which Appium keeps getting stuck at:

[debug] [ADB] Running /Users/ysxb111/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“192.168.56.101:5555”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]

[debug] [ADB] Running /Users/ysxb111/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“192.168.56.101:5555”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]

Please do let me know if there is any way to fix this problem. I have been trying to resolve this for over a week, and would sincerely appreciate your guidance ASAP!

What’s the error reported in the server log? Without that, I can only guess what the problem is.

Try uninstalling the two apps before you run your automation

adb uninstall io.appium.settings
adb uninstall io.appium.unlock

If that fixes the problem, you have a workaround. Failing that, I’ll await the error messages from the server log.

1 Like

Already tried doing that, but it doesn’t fix the problem :frowning: Literally got stuck on the same command again:

[debug] [AndroidDriver] Pushing settings apk to device…

[debug] [ADB] Running /Users/ysxb111/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“emulator-5554”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]

It gets stuck at the above command so there is no error message after that command in the Appium logs :confused:

What happens when you run the command manually?

/Users/ysxb111/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk

Is there are reason you are using a non-default port for Appium, i.e. 4723?

1 Like

Hi All,

Can someone please help to resolve this error.?

An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘/Users/user1/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M33VNBVK install /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk’ exited with code 1’; Stderr: ‘adb: failed to install /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]’; Code: ‘1’

You are getting this error because the unlock_api-debbug.apk exist in your capabilities.

How to resolve it? you can change your DesiredCapabilities from before passing them to your driver.

Appium server, through UIautomator2 requires four main caps: platformName, udi, platformVersion, browserName and deviceName.

You really do not need to use “app” capability

There many colors and flavor to set capabilities based on what you are testing (androidwebapplications, ioswebapplications, native android,… etc)

Unless your requirements require you to have app, you are locked down. Otherwise you are flexible to choose.

Alternatively you can use this…

DesiredCapabilities caps = new DesiredCapabilities();

// caps.setCapability(“deviceName”, “Android_GalaxyS7_fcb9cebe”);
// caps.setCapability(“udi”, “fcb9cebe”);
// caps.setCapability(“platformName”, “Android”);
// caps.setCapability(“platformVersion”, “8.0.0”);
// caps.setCapability(“browserName”, “Chrome”);
// caps.setCapability(“noReset”, true);

    caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
    caps.setCapability(MobileCapabilityType.UDID, "fcb9cebe");
    caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.0.0");
    caps.setCapability(MobileCapabilityType.DEVICE_NAME, "Android_GalaxyS7_fcb9cebe");
    caps.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");

    System.setProperty("webdriver.chrome.driver", "C:\\Users\\   YOUR USER 

\selenium utilities\drivers\chromedriver.exe");

// caps.setCapability(“appPackage”, “com.android.mycalculator”); //for native app
// caps.setCapability(“appPackage”, “com.android.mycalculator.Calculator”); //for native app

    //Appium as a Server-Client architecture
    //server address that talks to the mobile device.
    WebDriver driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    driver.get("https://www.tdameritrade.com/home.page");

    driver.navigate().to("http://appium.io/docs/en/writing-running-appium/web/mobile-web/");
    driver.navigate().back();
    driver.navigate().forward();

Remember URL throws MalformedURLException