Appium Android bootstrap socket crashed: Error: connect ECONNREFUSED - android

The problem
I have an already working appium tests suite on my MacOS desktop, but when i try to run the same tests on an Ubuntu 16.04 desktop, I get the following error and appium gets closed automatically.
Android bootstrap socket crashed: Error: connect ECONNREFUSED
Also, just to be clear, i'm not trying to run simultaneous tests, just a single emulated android device.
Environment
Appium version: 1.6.3-Beta. Also tried with 1.5.3 and got the same error.
Last Appium version that did not exhibit the issue (if applicable): Not applicable.
Desktop OS/version used to run Appium: Ubuntu 16.04
Node.js version (unless using Appium.app|exe): 7.6.0. But got the same error with v6.
Mobile platform/version under test: Andorid 6 (Marshmallow)
Real device or emulator/simulator: Simulator
Appium CLI or Appium.app|exe: Appium CLI
Details
Been stuck on this for a few days. Saw some question referring to simultaneous tests on the internet, but its not my case. I'm trying to run my tests on a single emulated android device.
Also tried to change the bootstrap port using the -bp option, and set the localhost address using -a 127.0.0.1, but no success.
Link to Appium logs
https://gist.github.com/BernalCarlos/752efe621a55a2b2b0d07b966c8b5354
Thank you on advance.

Solved the problem by making a fresh install of linux mint 18.1.
Still don't know why this showed up in ubuntu 16.04.

I had the similar problem. Set ADB path in system variable as C:\Users\<username>\AppData\Local\Android\Sdk\platform-tools
This will fix the issue.

I solved the problem adding the appium server argument --suppress-adb-kill-server, it prevents killing the adb server socket

Related

Error in meteor install-sdk android on windows 10

I got an issue on meteor JS on my windows 10, I have installed android studio and Java 8 JDK. On my meteor project I tried to build an android by typing meteor install-sdk android, but I got an error of This command is not yet available on Windows. .. Does anyone have an idea about this?
I know this was posted a year ago, but I found a fix recently, just in case anybody gets stuck on this and needs help.
It's from this link: https://github.com/meteor/meteor/issues/4155#issuecomment-384105563
But I'll repost the solution with a few extra changes I had to make by myself.
Basically you need to install Android studio and run it to get the Android SDK, install the Java JDK, and install Cordova. After this you can add the android platform to meteor.
Steps:
Install Android Studio
Run Android Studio once for download, full installation, and accept terms
Update npm with npm i npm
Run npm install cordova -g (-g flag for global install)
Run meteor npm i -g write-file-atomic path-is-inside async-some dezalgo
Run meteor add-platform android
After doing this, you should be able to run meteor run android-device to run on your Android device using a USB cable.
NOTE:
If you are connected to a WiFi network while running meteor run android-device, you might get an error similar to this:
Error detecting IP address for mobile app to connect to:
Found multiple network interfaces with non-internal IPv4 addresses:
'some IP address', 'some IP address'
Please specify the address that the mobile app should connect
to with --mobile-server.
To fix this, modify the command to:
meteor run android-device --mobile-server <ip.of.my.device>
Of course, ensure your PC and Android device are on the same WiFi network.
Go to Settings>About Device>Status to get your current IP Address on your Android device.
The app will now be installed on your phone over the WiFi connection.
(It might take a while though)
Hope this helps.
Cheers.

react-native run-android: usb debugging not working

I have installed the development environment for react native on Windows 7 using the instructions here.
I have installed the following packages:
Python 2.7
node 4.2.4
npm 2.14.12
react-native-cli 0.1.10
react-native 0.18.0-rc
Android SDK
I can generate a skeleton project using the command react-native init Test.
However, when I execute the command react-native run-android, the following error occurs: Unable to install path\to\app-debug.apk.
The device, a Samsung Galuxy running Android 5.0.1, is connected to my PC and USB debugging on the phone has been enabled. When I type adb devices the phone appears in the list.
I can download the apk to the phone manually using the command adb install. However, when I run the app, a red screen appears with the error "Unable to download js bundle." This error persists even after I do the following:
Start the local development server using react-native start
Executing the command: adb reverse tcp:8081 tcp:8081
On the phone, setting the debug server host and port to localhost:8081
Update: I have solved one problem by downloading gradle to version 1.2.3 as described here. However, the red screen still appears with the error Unable to download js bundle.
What could be the problem?
You are working fine. for this problem have added the IP address in device Setting server host. one more thing your machine and device should have on same network.

Jenkins cannot connect to android emulator

I'm using Jenkins for continous integration on an android emulator to run instrumentation tests with the espresso framework. Unfortunately the server is not able to connect to the emulator. I have a master instance which delegates the push events from GitHub to the slave instance where the android sdk is installed. I installed the android-emulator-plugin and configured it like described. At first the Jenkins starts the emulator, but it cannot connect to it afterwards. This is the result:
I also cannot connect to the emulator when I'm on the slave machine. But if I use 127.0.0.1 instead of localhost the adb tool can connect to the emulator:
Is it possible to use 127.0.0.1 instead of localhost with the android-emulator-plugin? I already specified the enviorment variables $ANDROID_AVD_DEVICE and $ANDROID_SERIAL with no result. Any ideas?
I was fighting with it whole day. Just try to comment ipv6 in your /etc/hosts.
I fixed the problem by myself. I have checked out a fork on GitHub, which uses 127.0.0.1 instead of localhost. This did work for connecting to the emulator but not for running the instrumentation tests. I do not use Jenkins plugins for the connection anymore. I make the build with a shell script which contains all commands to start the AVD and the gradle tasks. Works fine for me. But thank you for the advice. Maybe I will try to comment ipv6 aswell, if I have the time to work on the Jenkins.

How to make generic Appium find_element_by_xpath method?

I am writing test cases for my application but i have a problem. When i use Genymotion for emulator. I got this path on Appium inspector and create my script for this path:
"//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.support.v4.view.ViewPager[1]/android.widget.RelativeLayout[1]/android.widget.Button[1]"
But if i use device "HTC One E8". I got this path on Appium inspector:
"//android.support.v4.view.ViewPager[1]/android.widget.Button[1]"
my script will fail? if i use different devices and emulators.
How can it be generic?.
PS: I used self.driver.find_element_by_android_uiautomator('new UiSelector().resourceId("welcome_button_meet_hopi")').click() before but it works on Appium on Ubuntu and it didnt work on Appium on OSX

Can't start Genymotion Emulator from Android Studio Plugin

I've seen many posts with a similar problem and tried many solutions but so far none have helped. This all started after I upgraded Genymotion from 2.5.2 to 2.6.0.
I'm using Android Studio 1.5.1 on Ubuntu 15.10 64 bit. The Genymotion plugin is version 1.0.7. VirtualBox is 5.0.12 r104815
When I try to start a Genymotion Emulator I get:
I have several machines defined and all do this.
However, I can start them from the Genymotion app.
One other piece of information...if I have Android Studio and Genymotion running I get the following error when I try to issue any adb command from the command line:
adb server is out of date. killing...
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
I've tried restarting the computer, restarting Android Studio, and removing and reloading the plugin. I've also set Genymotion to use the same adb that Android Studio uses.
Any ideas? Let me know if you need more info.
Thanks,
Rich
This is actually 2 separate problems and I've found the solution for one and a workaround for the other.
Can't start Genymotion Emulator from Android Studio Plugin - I resolved this for now by reverting to Genymotion 2.5.2. I'll still need to figure out why 2.6.0 causes a problem but for now I can start emulator machines from the Android Studio plugin.
adb server is out of date - This is caused by more than one instance of adb on the machine. In my case, Android Studio was using the one in ~/Android/Sdk/platform-tools, but when I tried issuing adb commands in terminal it was using the one in /usr/bin. I'll either try creating a symbolic link in /usr/bin to point to ~/Android/Sdk/platform-tools, or I'll add ~/Android/Sdk/platform-tools to my Path environment variable.
Rich

Categories

Resources