Hello everyone, As we have already talked about sessions and emulators in our previous blogs like how we will test our application with the help of an emulator. Now many of us may have this question is it also possible for us to validate or test our application on the real devices??
In this blog, we will learn to configure a real device for testing with Appium.
before configuring a real device we should know why do we need a real device??
testing our application on the real device may help us to solve some production issues in the earlier stage.
As we already know that in Appium for testing any application we need to define some desired capabilities, so same will go with real devices as well but before defining the desired capabilities we need to connect the real device with our laptop so that it is recognized by the system for the testing. Although it seems very simple in words, in reality, it is a little tricky and difficult task to make your device recognized. In this blog, we will discuss how we can use our mobile phone for testing any application.
Generally, developer options in mobile devices are hidden by default. We need to enable developer options first to proceed further. Now the question arises how we will do that ??
Here are the few steps for you, following these you will be able to enable the developer options.
Go to the settings menu and click on about phone icon.
After clicking on the about phone icon you will be redirected to a page containing all the information related to that phone. Now click on build version for 7 times, yes you read it correctly, you have to click 7 times on the build number(in my cases it is MIUI version).
once you will start clicking on the build version, you will get some pop-up messages stating “You are 4 steps away from being a developer“.
After clicking it for 7 times, you will again get a pop-up message stating “You are now a developer“. This message means that you have enabled the developer options on your phone.
Now, to verify that developer options are enabled or not, click on the back button and scroll down for the option “additional settings” and click on this option.
Additional settings before enabling developer options:
Additional settings after enabling developer options, here you can see the developer options:
now scroll down for the USB debugging option and enable it.
after enabling it, you will get a pop-up message stating “Allow USB Debugging?“
after clicking on the OK button, you will enable the debugging mode in your phone.
Now in your system, open the terminal and write the following command:
if your real device is not recognizable(due to any reason like developer options are not enabled or something went wrong), then you will get an empty list.
As we have successfully enabled the developer options, we will be able to see our real device on the list and we will be ready for testing our application with a real device.
Thanks a ton for reading this blog, I hope this will help.
See you soon in my next blog with some hands-on on Appium with the real devices.