question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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""

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:39 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
vasukiscommented, Aug 30, 2017

@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 .

2reactions
tjmahercommented, Jun 3, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command failed: C:\Windows\system32\cmd.exe /s /c ""C ...
Hi, Please help me in solving this. Error in Appium server: Checking if an update is available Update not available Launching Appium server ......
Read more >
Failed to start an Appium session, err was: Error - Stack Overflow
apk "" Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [ ...
Read more >
Failed to start an Appium session, err was: Error
apk info: Creating new appium session e26d70d7-f133-467e-ac6c-dc722ceff759 info: Starting android appium debug: Using fast reset? false
Read more >
c# - while executing my appium code on android emulator
You should use the correct device name - "emulator-5554" is probably not your correct device name. To fix this:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found