Forum Xamarin Test Cloud (Read Only)

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Trouble getting app tested on emulator

I've read through the documentation but am having trouble getting my Android app tested on an emulator (I haven't tried a physical device yet).

I have the following error:

Test Failed - AppLaunches
Message: SetUp: System.Exception : ApkFile or InstalledApp has not been configured. 

I don't know if this means I need to do something to my app to configure it for testing or if I haven't configured my tests to run the app. I've left the default StartApp function:

public static IApp StartApp(Platform platform)
{
    if (platform == Platform.Android)
    {
        return ConfigureApp
            .Android
            .StartApp();
    }

    return ConfigureApp
        .iOS
        .StartApp();
}

I've looked at other examples (and the guides on Xamarin) and it seems I'm supposed to provide an .apk file. The problem is, I have no idea what the APK path is - is this the path of the APK on my emulator? If so, how can I find this?

The documentation suggests using a relative path as follows:

IApp app = ConfigureApp
    .Android
    .ApkFile("../../../AndroidProject/bin/Debug/android.apk")
    .StartApp();

I tried setting a similar relative path, but I get the following:

Result Message: SetUp : System.Exception : ApkFile does not exist: C:\Users\vchel\Documents\AppName\AppName\AppName\bin\Debug\AppName.apk

That tells me that it's looking on my machine for the .apk, but that folder contains no .apk files - just dlls, mdbs, pdbs, and xmls. My app in particular is in that folder, but as a .dll, not APK.

What am I missing?

Best Answer

Answers

  • VictorChelaruVictorChelaru USMember ✭✭
    edited December 2016

    For some reason I thought that it would automatically create an APK when I ran the test, but I guess I have to do it manually. I did that, placed it in the right location, but now I have the following:

    SetUp : System.Exception : App installation failed with output:     pkg: /data/local/tmp/final-F6218940D8E51DF33C7D31726F297E3208C4B2AB.apk
    
    Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
    
    9899 KB/s (23672880 bytes in 2.335s)
    

    Update: I read through this thread: https://forums.xamarin.com/discussion/comment/216932#Comment_216932

    My app already has the INTERNET required permission, but still won't work.

  • VictorChelaruVictorChelaru USMember ✭✭

    I tried connecting to a physical device, and that time it deployed fine. Not sure why it didn't want to work on an emulator. Hopefully this thread helps future readers who are trying to get started with testing.

Sign In or Register to comment.