user2327528
user2327528

Reputation: 17

Appium could not find devices, restarting adb server

I have looked on both the net and on stackoverflow for this issue, there are quite a few answers on this topic but none of these have worked for me.

When I start Appium.exe, bearing the application (apk) path, package name and activity the Appium console displays the following error:

ERROR: error: Could not pre-launch appium: Error: Could not find a connected Android device

This is even before I get to code anything whatsoever. I have done some work with Android Web driver in the past and I have used the android adb from command line in the past with no issues at all. Using command line such as 'adb devices' I can see the physical device id attached as well as being able to install and launch any apks from commad prompt but yet this does not work with appium. Has anyone experienced this issue before?

I am using Widows 7, I have Android SDK and tools already installed, all environment paths are set such as:

ANDROID_HOME: C:\sdk\sdk Path: C:\sdk\sdk\platform-tools

I will be coding app tests in C# using selenium (if I ever get this to work that is). Any help will be much appreciated.

Upvotes: 0

Views: 3739

Answers (2)

Abhay
Abhay

Reputation: 29

This is what solved my problem-

  1. Open command prompt and type path.
  2. Check if this path is present C:\WINDOWS\system32. If not, go to step 3.
  3. Add path like this in your system variable %SYSTEMROOT%\System32

This happens when Appium/ADB has problem reading and expanding your System32 folder.

Upvotes: 3

Jess
Jess

Reputation: 3146

Yes, so the most finnicky part of Appium is the desired_capabilities and server_arguments.

So Step 1:

  • Get Appium configured so that the server is up without issue, and you can begin interacting with it in your code.

Issue:

  • It seems that you have 'Prelaunch Application' checked in the App Settings, which means that as soon as the Appium server is started, it will attempt to establish a connection to the phone or emulator.

  • Uncheck that.

You're going to have your tests instantiate the WebDriver session, with the needed desired_capabilties as defined in this section of their documentation

This should help you get it somewhat working.

I would suggest running Appium from the command line, so you have the most control over what's going on. (If thats a viable option)

The GUI app may have some issues and ignore settings you give it.

Upvotes: 0

Related Questions