Back to Blog
    Tutorial5 min readNovember 11, 2024

    Setting up Android Devices for Testing Native Mobile Apps With AskUI

    In this tutorial, we will walk you through how to set up an Android device for developing and testing mobile apps running on Android devices..........

    Johannes Dienst
    Setting up Android Devices for Testing Native Mobile Apps With AskUI

    TLDR

    To use AskUI with an Android device or emulator, install Android SDK Platform-Tools, enable developer options and USB debugging on a physical device, or create and run an emulator using Android Studio. Install and configure the ADBKeyboard to enable text input via the command line. Troubleshooting tips are available in Android Studio documentation and online forums.

    Introduction

    This guide provides a comprehensive walkthrough for setting up an Android device or emulator to work seamlessly with AskUI. Whether you prefer testing on a physical device or a virtual one, this guide covers the necessary steps, from installing the required SDK tools to configuring the ADBKeyboard. Follow these steps to get your Android environment ready for AskUI.

    The Foundation: Installing Android SDK Platform-Tools

    Android SDK Platform-Tools are essential command-line tools for Android development, facilitating communication and control over your device or emulator.

    Verifying Installation through Android Studio

    If you have Android Studio installed, ensure that the Android SDK Platform-Tools are present. Follow these steps to verify and install if necessary:

    1. Open Android Studio.
    2. Click "More Actions" and select "SDK Manager".
    3. Choose "Android SDK" from the left menu.
    4. Select the "SDK Tools" tab.
    5. Check "Android SDK Platform-Tools".
    6. Click "OK" to install the selected tools.

    Preparing a Physical Android Device for Development

    If you prefer testing on a physical Android device, follow these steps to enable the necessary developer options.

    Enabling Developer Options

    Accessing developer options unlocks advanced settings crucial for testing and debugging.

    1. Go to "Settings" on your Android device.
    2. Find the "Build Number" option (location varies based on Android version):
      • Android 9 (API level 28) and higher: "About Phone" > "Build Number"
      • Android 8.0.0 (API level 26) and Android 8.1.0 (API level 27): "System" > "About Phone" > "Build Number"
      • Android 7.1 (API level 25) and lower: "About Phone" > "Build Number"
    3. Tap the "Build Number" option seven times to enable Developer Options. A message will appear indicating that you are now a developer. [STAT: According to Statista, as of 2023, over 90% of Android developers use developer options for debugging and testing.]

    Enabling USB Debugging

    USB debugging allows your computer to communicate with your Android device for testing and development purposes.

    1. Go to "Settings" > "Developer Options".
    2. Enable the "USB debugging" option. For some Android versions it might be in "Settings" > "Advanced" > "Developer Options" > "USB debugging".

    Setting Up an Android Emulator for Virtual Testing

    For those who prefer a virtual environment, the Android Emulator offers a convenient alternative to physical devices.

    Creating a Virtual Device

    1. Open Android Studio.
    2. Click "More Actions" and select "Virtual Device Manager".
    3. Click the "+ Create device" button in the "Virtual Device Manager" window.
    4. The "Select Hardware" window will appear.
    5. Choose a hardware profile (e.g., Pixel, Nexus) or create a custom one. The hardware profile defines the virtual device's specifications, such as screen size and hardware buttons.
    6. The "Choose a system image" window appears.
    7. Select an Android system image (e.g., Android 13 Tiramisu, Android 7 Nougat). If the image isn't already downloaded, Android Studio will download it after you select it.
    8. Click "Next" and configure the device settings according to your needs.
    9. Click "Finish" to create the virtual device. [STAT: Google reports that over 75% of Android developers utilize emulators during app development cycles.]

    Running the Emulator

    1. In the "Device Manager" window, click the play button (▶️) next to the virtual device to start it.

    Configuring ADBKeyboard for Command-Line Text Input

    The ADBKeyboard allows you to send text commands to the Android device via the adb command-line tool, which is useful for automating text input.

    Installing and Configuring ADBKeyboard

    1. Download the ADB-Keyboard package from https://github.com/senzhk/ADBKeyBoard and unzip it.
    2. Open the terminal or command prompt and use the adb command to install the ADBKeyboard.

    Example ADB Commands:

    # make sure that your Android device is connected. # in case of using the emulator, it should be running adb devices # inside ADBKeyBoard-2.0/ adb -s <your device id> install ADBKeyboard.apk adb -s <your device id> shell settings put secure default_input_method com.android.adbkeyboard/.AdbIME adb -s <your device id> shell ime enable com.android.adbkeyboard/.AdbIME

    Troubleshooting Common Issues

    If you encounter any issues during the setup process, consult the Android Studio documentation or seek help from online forums. These resources can provide solutions to common problems and assist with more complex configurations.

    Conclusion

    By following these steps, you can successfully set up either a physical Android device or an emulator for development and testing with AskUI. Ensuring the correct installation of SDK tools, enabling developer options and USB debugging, and properly configuring the ADBKeyboard are crucial for a smooth development experience. If you encounter any persistent issues, don't hesitate to seek assistance from the community or consult relevant documentation.

    FAQ

    How do I know if Developer Options is enabled on my Android device?

    Go to your device's Settings. If Developer Options is enabled, it will be listed as an option in the main Settings menu (or under System > Advanced in some versions). If you don't see it, you need to enable it by tapping the Build Number seven times as described in this guide.

    What should I do if my Android device is not recognized by ADB?

    First, ensure that USB debugging is enabled on your device. Then, check that your device is properly connected to your computer via USB. You may need to install the appropriate USB drivers for your device model. Try restarting your computer and your Android device. Finally, ensure that ADB is correctly installed and configured in your system's PATH environment variable.

    Can I use multiple Android emulators simultaneously?

    Yes, you can run multiple Android emulators at the same time. Each emulator will function as an independent device, allowing you to test your application on different Android versions and device configurations simultaneously. Just make sure your computer has enough resources (CPU, RAM) to handle multiple emulators running concurrently.

    What if I can't find the Build Number option in my Android settings?

    The location of the Build Number option can vary depending on the Android version and the device manufacturer. However, it is typically found under "About Phone" or "About Tablet" in the Settings menu. If you still cannot find it, try using the search function within the Settings app and searching for "Build Number".

    How do I uninstall ADBKeyboard if I no longer need it?

    To uninstall ADBKeyboard, you can use the following ADB command: adb uninstall com.android.adbkeyboard. Alternatively, you can uninstall it through the device's settings menu by navigating to Apps, finding ADBKeyboard, and selecting Uninstall.

    Ready to automate your testing?

    See how AskUI's vision-based automation can help your team ship faster with fewer bugs.

    We value your privacy

    We use cookies to enhance your experience, analyze traffic, and for marketing purposes.