Xamarin UI Test failed with : error: cannot bind listener: cannot bind to 127.0.0.1:62706: An attemp

BuddhimaKudagamaBuddhimaKudagama ✭✭USMember ✭✭

I added a new xamarin UI test project to my xamarin forms project. and when I was ruinning it for android app, I got below error.

Message: SetUp : System.Exception : Failed to execute: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:62706 tcp:62706 - exit code: 1
error: cannot bind listener: cannot bind to 127.0.0.1:62706: An attempt was made to access a socket in a way forbidden by its access permissions. (10013)

Here is my app initializer

public class AppInitializer
{
public static IApp StartApp(Platform platform)
{
if (platform == Platform.Android)
{
return ConfigureApp.Android
.ApkFile($"D:/Projects/MyApp/com.MyApp.Mobile.apk")
.EnableLocalScreenshots()
.StartApp(AppDataMode.Clear);
}

        return ConfigureApp.iOS.StartApp();
    }
}

Here is the test method

[Test]
public void WelcomeTextIsDisplayed()
{
// AppResult[] results = app.WaitForElement(c => c.Marked("Welcome to Xamarin.Forms!"));
// app.Screenshot("Welcome screen.");
app.Repl();
Assert.IsTrue(true);
}

Best Answer

Answers

Sign In or Register to comment.