Error: Could not find a connected Android device

Appium works fine on our Samsung Galaxy Nexus however when we try to run it on our Nexus 5 it fails to start the session with "Error: Could not find a connected Android device"
any idea what can cause this issue?

Environment info:
MAC 10.9.5
Appium VER: 1.3.7
Platform: Nexus 5 with Android 5.1

============ LOG ==============

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --command-timeout “7200” --session-override --automation-name “Appium” --platform-name “Android” --platform-version “4.4”

info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)

info: Appium REST http interface listener started on 0.0.0.0:4723

info: [debug] Non-default server args: {“sessionOverride”:true,“platformName”:“Android”,“platformVersion”:“4.4”,“automationName”:“Appium”,“defaultCommandTimeout”:7200}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: <-- GET /wd/hub/status 200 10.153 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: <-- GET /wd/hub/status 200 5.190 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/sgmacbookpro/Appium/Android/SkyGiraffe.apk",“appPackage”:“com.skygiraffe.operationaldata”,“appActivity”:“com.skygiraffe.operationaldata.LoginScreenActivity”,“appium-version”:“1.3.7”,“platformVersion”:“5.1”,“browserName”:“android”,“platformName”:“Android”,“version”:"",“deviceName”:“Nexus 5”,“platform”:“ANDROID”}}

info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)

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. : appium-version, version, platform
info: [debug] Using local app from desired caps: /Users/sgmacbookpro/Appium/Android/SkyGiraffe.apk

info: [debug] Creating new appium session cf4d96ec-1e60-45c2-9c9f-0973c3ddc94a

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.8.0_40

info: [debug] Checking whether adb is present

info: [debug] Using adb from /Users/sgmacbookpro/Appium/sdk/platform-tools/adb
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

info: [debug] Could not find devices, restarting adb server…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb kill-server

info: [debug] Getting connected devices…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

info: [debug] Could not find devices, restarting adb server…

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}},“sessionId”:“cf4d96ec-1e60-45c2-9c9f-0973c3ddc94a”}

info: <-- GET /wd/hub/status 200 1.729 ms - 155 {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}},“sessionId”:“cf4d96ec-1e60-45c2-9c9f-0973c3ddc94a”}

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb kill-server

info: [debug] Getting connected devices…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

info: [debug] Could not find devices, restarting adb server…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb kill-server

info: [debug] Getting connected devices…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

info: [debug] Could not find devices, restarting adb server…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb kill-server

info: [debug] Getting connected devices…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

info: [debug] Could not find devices, restarting adb server…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb kill-server

info: [debug] Getting connected devices…

info: [debug] executing cmd: /Users/sgmacbookpro/Appium/sdk/platform-tools/adb devices

info: [debug] 0 device(s) connected

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: Could not find a connected Android device.

info: [debug] Error: Could not find a connected Android device.
at ADB.getDevicesWithRetry (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:603:15)
at androidCommon.prepareActiveDevice (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:400:12)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:326:26)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17
at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:251:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:615:34
at androidCommon.ensureDeviceLocale (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:371:45)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find a connected Android device.)”,“origValue”:“Could not find a connected Android device.”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 30590.991 ms - 206

PLS ignore this post since i found the root cause for this issue.
the USB debugging mode was off.

menypeled, can you check whether you device is connected or not by following command:

Open your command prompt.
Then input “adb devices” and click enter.
If it shows a device with connected status then it indicates your device is connected else the device is not connected.

The probable reason could be your phone driver files are not properly installed. You need to install proper google nexus drivers. Once installed, if you issue the above command, then you will see device with connected status.

You might have samsung drivers so those devices will be connected, but not the google device drivers.

And also as per your logs, no device is connected.