All Downloads are FREE. Search and download functionalities are using the official Maven repository.

automated.platforms.mobile.android.ManageEmulator Maven / Gradle / Ivy

The newest version!
package automated.platforms.mobile.android;

import automated.os_operations.Services;

import static automated.os_operations.Services.runProcess;

/**
 * Created by Ismail on 1/9/2018.
 * This class contains methods that creates and configure
 * Android emulator to be used in running mobile Android test cases
 */
public class ManageEmulator {

    /*************** Class Methods Section ***************/
    // This method to Create a specific Emulator
    // to be used in running Android mobile test cases
    // on virtual devices
    public static void createAVD(String virtualMobile) {
        /* Here need to implement creation only */
    }

    // This method to launch a specific Emulator
    // to be used in running Android mobile test cases
    // on virtual devices
    public static void launchAVD(String virtualMobile) {
        // Check if Emulator exist with same name
        Boolean emulatorStatus = verifyEmulator(virtualMobile);

        // If Emulator isn't exists then create
        // Emulator by calling createAVD method
        if (!emulatorStatus)
            createAVD(virtualMobile);
        // Start launching Emulator
        Services.runProcess("avdmanager create avd -n test -k 'system-images;android-25;google_apis;x86'");
    }

    // This method to delete a specific Emulator
    public static void deleteAVD(String virtualMobile) {
        /* we need to check if avd exists then delete */
    }

    /* This method under still implementation */
    // This method to check if Emulator with specific name
    // is already exists to prevent duplication
    // If yes then return a true else will return false
    private static Boolean verifyEmulator(String emulatorName) {
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy