Forum Xamarin Test Cloud (Read Only)
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Can't start any UI tests, error: cannot bind to socket: No error

IgorPerunovicIgorPerunovic USUniversity

I have a simple test that is simply this:

    IApp app;
    [SetUp]
    public void Setup() 
    { 
        app = ConfigureApp.Android.ApkFile(apkpath).StartApp();
    }

    [Test]
    public void test() 
    { 
        app.Repl(); 
    }

When I try to run it, the app starts, but the test() fails. I get an error message saying:

Result Message:
SetUp : System.Exception : Failed to execute: C:...\Android\android-sdk\platform-tools\adb.exe -s YT9108P68V forward tcp:63599 tcp:63599 - exit code: 1
error: cannot bind to socket: No error
error: cannot bind to socket: No error
Result StackTrace:
at Xamarin.UITest.Shared.Processes.ProcessRunner.Run(String path, String arguments)
at Xamarin.UITest.Shared.Android.Commands.CommandAdbPortForward.Execute(IProcessRunner processRunner, IAndroidSdkTools androidSdkTools)
at Xamarin.UITest.Shared.Execution.Executor.Execute[TDep1,TDep2](ICommand`2 command)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.LaunchApp(ApkFile appApkFile, ApkFile testServerApkFile, Int32 testServerPort)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at Tests.Unit.UseCases.AccountBalanceDetails.Setup() in c:..\Tests.Unit\UseCases\AccountBalanceDetails.cs:line 23

What could be the reason for this? I checked the ports using "netstat -a -n -o" in cmd, the port in question is not mentioned anywhere. I even reinstalled the unit test NUGet package, android SDK etc, nothing helps.

Did anyone else encounter this error? How can I solve this?

Tagged:
Sign In or Register to comment.