How to Run Apps in Android Studio
There are two ways in which you can test your apps
- On a real device
- On a virtual device

👉How to Enable developer options in android devices
For Google pixel 👉 Settings👉 About phone👉Build number
For Samsung 👉 Settings👉 About phone👉Software information 👉Build number
Wireless debugging
To use wireless debugging
- Ensure that your workstation and device are connected to the same wireless network.
- Ensure that your device is running Android 11 or higher.
- Ensure that you have Android Studio Electric Eel installed.
- On your workstation, update to the latest version of the SDK Platform Tools.
To connect to your device, follow these steps
To pair your device with QR code
- Open Android Studio and select Pair Devices Using Wi-Fi from the run configurations menu.
- The Pair devices over Wi-Fi dialog appears
- Select Pair device with QR code and scan the QR code
- After pairing, you can attempt to deploy your app to your device.
To pair your device with pairing code
- Select Pair device with pairing code from the Pair new devices over Wi-Fi dialog.
- On your device, select Pair using pairing code.
- A six-digit code appears. Once your device appears on the Pair devices over Wi-Fi window
- Enter the six-digit code shown on your device and select Pair .
- After pairing, you can attempt to deploy your app to your device.
Android Virtual Device (AVD)
To run an Android app in an emulator on your computer
Create a virtual device
The Device
Manager dialog opens. If you created a
virtual device previously, it's listed in this dialog.
2. C lick Create virtual device.
The Virtual
Device Configuration dialog appears.
The dialog shows a list of pre-configured devices, organized by category, from which you can choose. For each device, the table provides a column for its display size (in inches), screen resolution (in pixels), and pixel density (number of pixels per inch).
3. Select Phone as the category.
4.
Select a phone, such as the Pixel 5,
and then click Next.
This step opens another screen where you can choose the
version of Android to run on your virtual device. This lets you test your app on
different versions of Android.
This action opens another screen, where you can choose
additional configuration details for your device.
Note: If you see the red warning about using an image with
Google APIs like in the screenshot above, you can disregard it for now.
5. In the AVD Name field, enter a name for your AVD or use the default. Leave the rest of the fields unchanged.
6. Click Finish.
This action returns to the Android Virtual Device Manager pane.
Run your app on the Android Emulator
The virtual device starts just like a physical device.
Expect this to take a while—potentially several minutes—for the emulator to
start for the first time. The virtual device should open beside the code
editor.
When your app is ready, it opens on the virtual device.
If you enjoyed reading , Show some Love by
clapping 👏 on this post!
If you have any suggestion share with me.
0 Comments