- Article
There are several ways to test and debug your Android application using a real device or emulator on your Windows machine. We have outlined a few recommendations in this guide.
Run on a real Android device
To run your app on a real Android device, you will first need to enable your Android device for development. Developer options on Android have been hidden by default since version 4.2 and enabling them can vary based on the Android version.
Enable your device for development
For a device running a recent version of Android 9.0+:
- Connect your device to your Windows development machine with a USB cable. You may receive a notification to install a USB driver.
- Open the Settings screen on your Android device.
- Select About phone.
- Scroll to the bottom and tap Build number seven times, until You are now a developer! is visible.
- Return to the previous screen, select System.
- Select Advanced, scroll to the bottom, and tap Developer options.
- In the Developer options window, scroll down to find and enable USB debugging.
For a device running an older version of Android, see Set Up Device for Development.
Run your app on the device
In the Android Studio toolbar, select your app from the run configurations drop-down menu.
(Video) Which mobile app testing is better? Real device vs Emulator vs SimulatorFrom the target device drop-down menu, select the device that you want to run your app on.
Select Run ▷. This will launch the app on your connected device.
Run your app on a virtual Android device using an emulator
The first thing to know about running an Android emulator on your Windows machine is that regardless of your IDE (Android Studio, Visual Studio, etc), emulator performance is vastly improved by enabling virtualization support.
Enable virtualization support
Before creating a virtual device with the Android emulator, it is recommended that you enable virtualization by turning on the Hyper-V and Windows Hypervisor Platform (WHPX) features. This will allow your computer's processor to significantly improve the execution speed of the emulator.
To run Hyper-V and Windows Hypervisor Platform, your computer must:
(Video) Android App testing with Android Emulator and Burp Suite - Basic Tutorial
- Have 4GB of memory available
- Have a 64-bit Intel processor or AMD Ryzen CPU with Second Level Address Translation (SLAT)
- Be running Windows 10 build 1803+ (Check your build #)
- Have updated graphics drivers (Device Manager > Display adapters > Update driver)
If your machine doesn't fit this criteria, you may be able to run Intel HAXM or AMD Hypervisor. For more info, see the article: Hardware acceleration for emulator performance or the Android Studio Emulator documentation.
Verify that your computer hardware and software is compatible with Hyper-V by opening a command prompt and entering the command:
systeminfo
In the Windows search box (lower left), enter "windows features". Select Turn Windows features on or off from the search results.
Once the Windows Features list appears, scroll to find Hyper-V (includes both Management Tools and Platform) and Windows Hypervisor Platform, ensure that the box is checked to enable both, then select OK.
Restart your computer when prompted.
Emulator for native development with Android Studio
When building and testing a native Android app, we recommend using Android Studio. Once your app is ready for testing, you can build and run your app by:
In the Android Studio toolbar, select your app from the run configurations drop-down menu.
From the target device drop-down menu, select the device that you want to run your app on.
Select Run ▷. This will launch the Android Emulator.
Tip
Once your app is installed on the emulator device, you can use Apply Changes
to deploy certain code and resource changes without building a new APK. See the Android developer guide for more information.
Emulator for cross-platform development with Visual Studio
There are many Android emulator options available for Windows PCs. We recommend using the Google Android emulator, as it offers access to the latest Android OS images and Google Play services.
Install Android emulator with Visual Studio
If you don't already have it installed, download Visual Studio 2019. Use the Visual Studio Installer to Modify your workloads and ensure that you have the Mobile development with .NET workload.
Create a new project. Once you've set up the Android Emulator, you can use the Android Device Manager to create, duplicate, customize, and launch a variety of Android virtual devices. Launch the Android Device Manager from the Tools menu with: Tools > Android > Android Device Manager.
Once the Android Device Manager opens, select + New to create a new device.
You will need to give the device a name, choose the base device type from a drop-down menu, choose a processor, and OS version, along with several other variables for the virtual device. For more information, Android Device Manager Main Screen.
In the Visual Studio toolbar, choose between Debug (attaches to the application process running inside the emulator after your app starts) or Release mode (disables the debugger). Then choose a virtual device from the device drop-down menu and select the Play button ▷ to run your application in the emulator.
(Video) This Is The BEST $120 Budget Android Phone I’ve Ever Tested!
Additional resources
FAQs
Is testing on real device is required even though a emulator provides the same capability as that of a device True or false ›
This is because the emulator gives the facilities to test the software, that the software behaves like the real-time testing. The above question also states the same, Hence true is the correct answer for the above question.
How to run test on Android Emulator? ›- Add an AVD Manager Step. ...
- Add a Android Build for UI Testing Step, and configure the required inputs.
- Add a Wait for Android emulator Step.
- Add an Android Instrumented Test Step, and configure the required inputs.
Emulators and simulators are programs that create virtual mobile devices on a computer. Modern developers use them to test their mobile apps in 'near-native' environments during development.
What is the difference between testing on emulator and real device? ›Real Device Testing vs.
Real device testing is a recommended component of a comprehensive mobile app testing strategy, especially when used in combination with virtual devices (Android emulators and iOS simulators). Emulators and simulators are faster to provision than real devices, as they are software-driven.
Emulators are virtual testing software on a computer that imitates both the software and hardware configuration of a mobile device or another computer. It works on an ISA (Instruction Set Architecture), which is written in machine language that the processor understands.
What Cannot be tested with mobile device emulator? ›It cannot test the device native features like gestures, GPS sensors, network connectivity, etc. Emulators can't replicate the app's behavior while receiving phone calls, texts, touch screen issues.
How to test Android app without emulator? ›Conclusion. If you want to play your favorite Android games or use other Android apps on your PC, you do not need to install an emulator. You can use MirrorTo screen-mirroring application, Android-x86 software, or chrome extension to run Android apps on PC without using an emulator.
How to test Android Auto app in emulator? ›Compile and install your app on the device. Install Android Auto on the device. If Android Auto is already installed, make sure that you are using the latest version. Open the SDK Manager and navigate to the SDK Tools tab, then download the Android Auto Desktop Head Unit Emulator package.
How do I use my Android device as an emulator? ›In the Android SDK Manager, select Tools | Manage AVDs. In the Android Virtual Device Manager, click the New button to create a new virtual device. In the Create new Android Virtual Device (AVD) dialog box, select an Android device to emulate, and enter the details describing the Android device you want to emulate.
Can Android emulator be detected? ›Identifying network parameters can give clues as to which environment the app is running on. You can also analyze the TTL (time-to-live) value to detect an emulator. Emulators have longer TTL values than actual devices, often a clear telltale sign you can use in Android emulator detection.
How do you pass emulator detection? ›
- The IMEI is stored as a text string, so we will search for a 'text string' accordingly. ...
- Note once again this is an ascii string, so the zeroes are 0x30 .
- In this case, we just replace four characters with 1234 by updating 0x31, 0x32, 0x33, and 0x34. ...
- Just save and exit.
Emulators are used to mimic the real device, its software and its hardware. On the other hand the job of a simulator is to provide a software environment to run the app. It only impersonates the software part of the device.
What is an example of an emulator? ›Examples of Emulators
Emulators like BlueStacks make it possible to use Android apps on Windows and Mac. Programs like Xcode can run iOS on Mac and Windows. Appetize.io is a browser-based emulator that lets you use iOS apps on any PC. WINE runs Windows applications on the Linux OS.
Android Emulator allows you to run emulations of Android devices on Windows, macOS or Linux machines. The Android Emulator runs the Android operating system in a virtual machine called an Android Virtual Device (AVD). The AVD contains the full Android software stack, and it runs as if it were on a physical device.
What is the difference between emulator and simulator in mobile testing with example? ›A simulator creates an environment that mimics the behaviors, variables, and configurations that exist in an iOS app's production environment. An emulator is designed to mimic all of the hardware and software features for the Android app production environment of a real device.
What is the purpose of Android emulator? ›The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device.
What does a device emulator do? ›A device emulator is a program or device that enables a computer system to behave like another device. An emulator essentially allows one computer system (aka “the host”) to imitate the functions of another (aka “the guest”).
What is the benefit of emulator Android? ›- Gaming Benefits. Bigger screen, never miss a detail. 100% accuracy with keyboard & mouse controls. Mobile-exclusive Android Games on PC. Multiple games at the same time.
- Other Amazing Benefits. No worry about battery life. No need for high-end phones. Effortless Multitasking.
Open Android emulator and go to the Extended Controls. Then go to the setting => proxy(Tab), uncheck "Use Android studio HTTP proxy setting" and click "Apply". I on the other hand had to check it back again to make internet work. :( worked like a charm, but had to restart the emulator for it to pick up the setting.
Can you get in trouble for emulation? ›If you own a game physically, you are likely to emulate or own a ROM of the game. However, there's no legal precedent in the United States to say it's illegal.
Should I use Android Emulator? ›
Android emulators help you transfer data faster and more efficiently than physical devices that you connect via USB. An emulator offers drag-to-drop capabilities that let you keep . apk files on the virtual device from your workstation or computer, which helps developers test apps quickly and more effectively.
What is the code to run test on Android phone? ›- How to enter Android hardware test codes. ...
- Key hardware info: *#0*# ...
- Key service info: *#*#4636#*#* ...
- LCD display test: *#*#0*#*#* ...
- Touch-screen test: *#*#2664#*#* ...
- Camera firmware info: *#*#34971539#*#* ...
- GPS test: *#*#1472365#*#*
Run Diagnostics on Samsung Phones
Samsung's Galaxy smartphones have a built-in diagnostics tool that's accessible from the keypad. Open the Phone app, tap the Keypad, and then type *#0*#. A diagnostic screen pops up with buttons for a variety of tests. Tap Red, Green, or Blue to test those pixel colors.
- Testing on Emulators or Simulators. This is a time-consuming and effort-intensive approach. ...
- Testing on a Real Device Cloud. This is one of the easiest ways.
Drag an APK or app bundle into the Editor window of Android Studio. Switch to the Project view in the Project window, then double-click the APK in the default build/output/apks/ directory. Select Build > Analyze APK in the menu bar, then select your APK or app bundle.
How to test an Android APK? ›- On the Android device, click on the ".apk" attachment in the e-mail in order to download it.
- Follow the on-screen instructions to install the application. ...
- When satisfied with the app's performance, you can go to the Google Play Store and submit the APK for distribution.
- Sign in to your Play Console.
- Select an app.
- On the left menu, select Release management > App releases.
- Next to the internal test track, select Manage internal test.
- Expand the “Manage testers” section. ...
- Next to “Choose a testing method,” select Internal test.
Enable USB debugging on your device
Enable USB debugging in the device system settings under Developer options. You can find this option in one of the following locations, depending on your Android version: Android 9 (API level 28) and higher: Settings > System > Advanced > Developer Options > USB debugging.
- Open DevTools by pressing F12.
- Click on the “Device Toggle Toolbar” available. ( ...
- Choose a device you want to simulate from the iOS and Android devices list.
- Once the desired device is chosen, it displays the mobile view of the website.
- Open a terminal window and enter the following command:
- After the console displays OK , enter the auth auth_token command.
- After you're connected to the console, enter console commands.
- To exit the console session, enter quit or exit .
Where is my Android emulator located? ›
The default location is the following, where name is the AVD name: macOS and Linux - ~/.android/avd/ name .avd/ Microsoft Windows XP - C:\Documents and Settings\ user \.android\ name .avd\ Windows Vista, and higher - C:\Users\ user \.android\ name .avd\
How do I disable Android emulator? ›To stop a running emulator, click Menu and select Stop. To clear the data for an emulator, click Menu and select Wipe Data.
Where is data stored in Android emulator? ›All applications and files that you have deployed to the Android emulator are stored in a file named userdata-qemu. img located in the C:\Users\<username>\. android\avd\<avd_name>. avd folder.
How do I unlock my Android emulator? ›Go to AVD manager screen, edit your Emulator and go to Advanced Settings . Select Cold boot as Boot option located in Emulated Performance section. This way you will be able to restart your emulator and get it unlocked without loosing data.
How to get data from Android emulator? ›You cannot get data's from Emulator. You can use Android devices for data's.
How to get device IP in Android emulator? ›In Emulator, swipe down from top-most, to open menu, In the menu, press and hold on WiFi, Finally, go to settings of current WiFi-connection, There you should see IP of Emulator process.
What are two uses of an emulator? ›Common uses of emulation include: Running an operating system on a hardware platform for which it was not originally engineered. Running arcade or console-based games upon desktop computers. Running legacy applications on devices other than the ones for which they were developed.
Is it legal to use an emulator? ›So, are emulators legal? Yes, they are, but it's all about how you use those ROM files. Downloading an emulator program is fine. Uploading files of games you own for other users to download and play on their emulators is not fine.
What does it mean to emulate someone? ›: to strive to equal or excel. : imitate. especially : to imitate by means of an emulator. : to equal or approach equality with. emulate.
What is an emulator in simple terms? ›An emulator is a hardware device or software program that enables one computer system (also known as a host) to imitate the functions of another computer system (known as the guest). It enables the host system to run software, tools, peripheral devices and other components which are designed for the guest system.
What is meant by emulator application? ›
: hardware or software that permits programs written for one computer to be run on another computer.
Is Android emulator software or hardware? ›An Android emulator is a tool that creates virtual Android devices (with software and hardware) on your computer. Note that: It is a program (a process that runs on your computer's operating system). It works by mimicking the guest device's architecture (more on that in a bit).
What is the example of mobile emulator? ›A mobile emulator, as the term suggests, emulates the device software and hardware on a desktop PC, or as part of a cloud testing platform. It is a complete re-implementation of the mobile software written in a machine-level assembly language. The Android (SDK) emulator is one such example.
What is simulator emulator and debugging? ›Definition. An emulator is a hardware or software that enables one computer system to behave like another computer system. In contrast, a debugger is a computer program that helps to test and debug other programs or target programs. This is the basic difference between emulator and debugger.
What is meant by simulator test? ›A simulation test, also called a walkthrough drill (not to be confused with the discussion-based structured walkthrough), goes beyond talking about the process and actually has teams to carry out the recovery process. A pretend disaster is simulated to which the team must respond as they are directed to by the DRP.
What is the system requirement for emulator? ›Emulator system requirements
16 GB RAM. 64-bit Windows, macOS, Linux, or ChromeOS operating system. 16 GB disk space.
How does an emulator compare to a real device for developing purposes? Emulators emulate (or imitate) another program or device, but real devices show the exact performance and functional environment where the application will be running.
When would you use an emulator instead of a simulator while performing mobile application testing? ›Emulators are preferable whenever the testing team needs to test the mobile's external behavior like calculating, making transactions, and so forth. Simulators are written in high-level languages. Emulators are written in machine-level assembly languages. The simulators can be difficult in terms of debugging purpose.
What do you use the emulator for? ›The most common uses for emulators are to play video games and run different operating systems — for example, you can put a Mac operating system on your Windows computer. Emulators can allow you to run apps that normally wouldn't work on your computer.
What is the required RAM for Android emulator? ›- 64-bit Microsoft® Windows® 8/10/11.
- x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD CPU with support for a Windows Hypervisor.
- 8 GB RAM or more.
- 8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)
- 1280 x 800 minimum screen resolution.
Do you have to own a game to play it on an emulator? ›
To play a game on a console emulator, you also need a copy of the original game file, which is typically stored in the ROM (read-only memory) format. ROM files are obtained by using special hardware that downloads data from a cartridge to a computer.
Do Android emulators need CPU or GPU? ›By default, the emulator decides whether to use hardware or software graphics acceleration based on your computer setup. If your GPU hardware and drivers are compatible, the emulator uses the GPU. Otherwise, the emulator uses software acceleration (using your computer's CPU) to simulate GPU processing.
Is 4gb RAM enough for Android emulator? ›4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image) 1280 x 800 minimum screen resolution.
What is most important for emulation? ›The CPU is definitely the biggest factor in the ability of your PC to play games on emulators, as it does all or most of the simulation of the console hardware.
What are the benefits of using Android Emulator? ›- Gaming Benefits. Bigger screen, never miss a detail. 100% accuracy with keyboard & mouse controls. Mobile-exclusive Android Games on PC. Multiple games at the same time.
- Other Amazing Benefits. No worry about battery life. No need for high-end phones. Effortless Multitasking.
Android Emulators vs Physical Devices
Android emulators simulate the hardware and software of Android devices on your computer so that you can test your Android apps without having a physical device in hand. While easily accessible and inexpensive, emulators have significant device hardware and software limitations.
An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator.
Is testing using emulators most reliable? ›Most developers agree that some combination of simulation/emulation and real devices is best for testing. Emulators are a good option in the development process because they're a faster option, but often are less accurate due to lack of human observation that is critical in testing.