I have been trying for several days to get Appium up and running. I feel that I am close but missing something.
I am using a Mac with OSX 10.9.4, Android Studio, ADB.
I am trying to get the Python > android_contacts.py script to run.
I have started my emulator and installed the ContactsManager.apk onto my emulator.
I open Terminal and do:
appium
python android_contacts.py
Then I get this output in Terminal:
info: [debug] Using local app from desired caps: /Users/Chris/Desktop/sample-code-master/sample-code/apps/ContactManager/ContactManager.apk
info: [debug] Creating new appium session e4258bd2-0dfa-440c-939b-f76472900e15
info: Starting android appium
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from /Applications/Android Studio.app/sdk/platform-tools/adb
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devicesâŚ
info: [debug] executing: â/Applications/Android Studio.app/sdk/platform-tools/adbâ 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: â/Applications/Android Studio.app/sdk/platform-tools/adbâ -s emulator-5554 wait-for-device
info: [debug] executing: â/Applications/Android Studio.app/sdk/platform-tools/adbâ -s emulator-5554 shell âecho âreadyââ
info: [debug] Starting logcat capture
error: Logcat capture failed: spawn ENOENT
info: [debug] Stopping logcat capture
At this point, nothing else happens. Iâve let it sit for quite a long time, tried clicking in the emulator, nothing seems to forward the action.
Any input or tips would be very much appreciated.
Some More Info:
I found the Appium GUI tool and started the server from there. Then I ran
python android_contacts.py
in the Terminal.
After 10 minutes of messages like this in the GUI:
info: â GET /wd/hub/status {}
info: [debug] Responding to client with success: {âstatusâ:0,âvalueâ:{âbuildâ:{âversionâ:â1.2.2â,ârevisionâ:âcf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4â}},âsessionIdâ:â73d3593c-65bc-45b0-a932-aaf24b3b63afâ}
info: â GET /wd/hub/status 200 0.637 ms - 155 {âstatusâ:0,âvalueâ:{âbuildâ:{âversionâ:â1.2.2â,ârevisionâ:âcf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4â}},âsessionIdâ:â73d3593c-65bc-45b0-a932-aaf24b3b63afâ}
It finally gave up, displaying this in the Terminal:
Traceback (most recent call last):
File âandroid_contacts.pyâ, line 23, in setUp
self.driver = webdriver.Remote(âhttp://localhost:4723/wd/hubâ, desired_caps)
File â/Library/Python/2.7/site-packages/appium/webdriver/webdriver.pyâ, line 35, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File â/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.pyâ, line 73, in init
self.start_session(desired_capabilities, browser_profile)
File â/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.pyâ, line 121, in start_session
âdesiredCapabilitiesâ: desired_capabilities,
File â/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.pyâ, line 171, in execute
response = self.command_executor.execute(driver_command, params)
File â/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.pyâ, line 349, in execute
return self._request(command_info[0], url, body=data)
File â/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.pyâ, line 417, in _request
resp = opener.open(request)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.pyâ, line 404, in open
response = self._open(req, data)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.pyâ, line 422, in _open
â_openâ, req)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.pyâ, line 382, in _call_chain
result = func(*args)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.pyâ, line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.pyâ, line 1187, in do_open
r = h.getresponse(buffering=True)
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyâ, line 1045, in getresponse
response.begin()
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyâ, line 409, in begin
version, status, reason = self._read_status()
File â/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyâ, line 373, in _read_status
raise BadStatusLine(line)
BadStatusLine: ââ
So⌠Seems like the Terminal / Python scripts canât connect to http://localhost:4723/wd/hub ?