appium: error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c ""C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""

The problem

I have created a AVD (named as deb) with android 7.0 API 24 and started (as a admin)- emulator is up and running Then started appium server (as a admin) and all good (Use Browser as Browser)

Now from Visual Studio selenium test the below code snippet trying to run (pretty basic - to lunch and go to a url)

[TestClass] public class DemoDevice { [TestMethod] public void AndriodTest() {

        try
        {
            DesiredCapabilities cap = new DesiredCapabilities();

           cap.SetCapability(MobileCapabilityType.BrowserName, "Browser");
            cap.SetCapability("device", "Android");
            cap.SetCapability(MobileCapabilityType.PlatformName, "Android");
            cap.SetCapability(MobileCapabilityType.DeviceName, "deb");
           // cap.SetCapability(MobileCapabilityType.AutomationName, "Appium");
            cap.SetCapability(MobileCapabilityType.PlatformVersion, "6.0");
            IWebDriver driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), cap, TimeSpan.FromSeconds(180));
            driver.Navigate().GoToUrl("xyz");
        }
        catch (Exception e)
        {

            Console.WriteLine(e.ToString());
        }
    }

However getting error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c ““C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk””

Full stack trace below (under appium logs)

Environment

  • Appium version (or git revision) that exhibits the issue: 1.4.16.1
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: Win 7
  • Node.js version (unless using Appium.app|exe):
  • Mobile platform/version under test:android 7.0
  • Real device or emulator/simulator:emulator
  • Appium CLI or Appium.app|exe:

Details

Describe in more detail the problem you have been experiencing, if necessary.

Link to Appium logs

info: --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Browser”,“device”:“Android”,“platformName”:“Android”,“deviceName”:“deb”,“platformVersion”:“6.0”}} info: Client User-Agent string: undefined 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. : device info: Set mode: Proxying straight through to Chromedriver info: [debug] Looks like we want chrome on android info: [debug] Creating new appium session 7fa96271-42fa-4da5-a21f-5de761094043 info: [debug] Checking whether adb is present info: [debug] Using adb from C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe info: [debug] Using fast reset? false 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:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” devices info: [debug] 1 device(s) connected info: Found device emulator-5554 info: [debug] Setting device id to emulator-5554 info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) info: [debug] executing cmd: “C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 wait-for-device info: [debug] executing cmd: “C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 shell “echo ‘ready’” info: [debug] Starting logcat capture info: [debug] Pushing unlock helper app to device… info: [debug] executing cmd: “C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk” 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:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”” Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]

info: [debug] Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c ““C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe” -s emulator-5554 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”” Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]

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:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n)”,“killed”:false,“code”:1,“signal”:null,“cmd”:“C:\WINDOWS\system32\cmd.exe /s /c ""C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""”,“origValue”:“Command failed: C:\WINDOWS\system32\cmd.exe /s /c ""C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n”},“sessionId”:null} info: <-- POST /wd/hub/session 500 1303.333 ms - 1372

Code To Reproduce Issue [ Good To Have ]

already gave

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 39 (12 by maintainers)

Most upvoted comments

@Rampra17 I resolved it.Please try the below command

adb uninstall io.appium.unlock

On Sat, Aug 26, 2017 at 12:06 AM, Rampra17 notifications@github.com wrote:

@vasukis https://github.com/vasukis hello vasukis, i am facing with the same issue did you resolve it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/appium/appium/issues/6858#issuecomment-325004080, or mute the thread https://github.com/notifications/unsubscribe-auth/AVJCF90FnCVWBpDDQrE5G1ucdP6NJd7Uks5sbxQ7gaJpZM4KAIrT .

I wrote a walkthrough of installing Appium Desktop for the Android at http://www.tjmaher.com/2017/04/learning-appium-what-is-appium-server.html

Yes, we have a beta pre-release ready now to try (https://github.com/appium/appium-desktop/releases).

True! You will find a new release on appium-desktop soon.That looks more promising. @dpgraham is on releasing a beta version soon.