Failed to install settings_apk-debug.apk

in the past few days i have been trying to set up appium and try it out, but whenever i try to run the test program it keeps failing, and i have no idea why.

here is the log:

info: → POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{},“capabilities”:{“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{}},“alwaysMatch”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“firstMatch”:}
info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_112-release)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : BROWSER_NAME, VERSION
info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session fe85a7a2-9322-474d-a78f-54719aec8cb1
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_77
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe
warn: No app capability, can’t parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device IBAAWC7S5H5HSGNR
info: [debug] Setting device id to IBAAWC7S5H5HSGNR
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR wait-for-device
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 22
info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn’t exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “rm -rf /data/local/tmp/strings.json”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n)”,“killed”:false,“code”:3221226356,“signal”:null,“cmd”:“C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""”,“origValue”:“Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n”},“sessionId”:null}
info: ← POST /wd/hub/session 500 10131.278 ms - 943
info: → POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{},“capabilities”:{“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{}},“alwaysMatch”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“firstMatch”:}
info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_112-release)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : BROWSER_NAME, VERSION
info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 73d8f1c2-e463-41ec-9553-dcbc73b3d147
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_77
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe
warn: No app capability, can’t parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device IBAAWC7S5H5HSGNR
info: [debug] Setting device id to IBAAWC7S5H5HSGNR
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR wait-for-device
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 22
info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn’t exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “rm -rf /data/local/tmp/strings.json”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n)”,“killed”:false,“code”:3221226356,“signal”:null,“cmd”:“C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""”,“origValue”:“Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n”},“sessionId”:null}
info: ← POST /wd/hub/session 500 9462.675 ms - 943
info: → POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{},“capabilities”:{“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“requiredCapabilities”:{}},“alwaysMatch”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“BROWSER_NAME”:“Android”,“VERSION”:“5.1”,“platformName”:“Android”,“deviceName”:“LENOVO Lenovo P70-A”},“firstMatch”:}
info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_112-release)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : BROWSER_NAME, VERSION
info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 00e59b18-1751-44cf-81df-76b72077166a
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_77
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe
warn: No app capability, can’t parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device IBAAWC7S5H5HSGNR
info: [debug] Setting device id to IBAAWC7S5H5HSGNR
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR wait-for-device
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 22
info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn’t exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “rm -rf /data/local/tmp/strings.json”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n)”,“killed”:false,“code”:3221226356,“signal”:null,“cmd”:“C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""”,“origValue”:“Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\n”},“sessionId”:null}
info: ← POST /wd/hub/session 500 8739.975 ms - 943

and here is my java code

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;

/**

  • Created by loise on 3/22/2017.
    */

public class CalcTest {
static WebDriver driver;

@Before
public void setUp() throws MalformedURLException{
    //Set up desired capabilities and pass the Android app-activity and app-package to Appium
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("BROWSER_NAME", "Android");
    capabilities.setCapability("VERSION", "5.1");
    capabilities.setCapability("deviceName","LENOVO Lenovo P70-A");
    capabilities.setCapability("platformName","Android");
    capabilities.setCapability("appPackage", "com.android.calculator2");

// This package name of your app (you can get it from apk info app)
capabilities.setCapability(“appActivity”,“com.android.calculator2.Calculator”); // This is Launcher activity of your app (you can get it from apk info app)
//Create RemoteWebDriver instance and connect to the Appium server
//It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities
driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
}

@Test
public void testCal() throws Exception {
    //locate the Text on the calculator by using By.name()
    WebElement two=driver.findElement(By.name("2"));
    two.click();
    WebElement plus=driver.findElement(By.name("+"));
    plus.click();
    WebElement four=driver.findElement(By.name("4"));
    four.click();
    WebElement equalTo=driver.findElement(By.name("="));
    equalTo.click();
    //locate the edit box of the calculator by using By.tagName()
    WebElement results=driver.findElement(By.tagName("EditText"));
    //Check the calculated value on the edit box
    assert results.getText().equals("6"):"Actual value is : "+results.getText()+" did not match with expected value: 6";
}
@After
public void teardown(){
    //close the app
    driver.quit();
}

}

anyone can tell me what is wrong?

1 Like

so i updated android build tools and i get a different error now

info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\Loise\AppData\Local\Android\sdk\platform-tools\adb.exe -s IBAAWC7S5H5HSGNR shell “echo ‘ready’””

i can confirm that using that command causes adb to crash on my computer, any idea how to fix this?

1 Like

i still haven’t found how to fix this issue, anyone can help?

1 Like