0
0
Android-kotlinHow-ToBeginner ยท 4 min read

How to Run Android App on Device: Step-by-Step Guide

To run an Android app on a device, first enable Developer options and USB debugging on your Android phone. Then connect the device to your computer via USB and use Android Studio to select the device and run the app.
๐Ÿ“

Syntax

Running an Android app on a device involves these key steps:

  • Enable Developer Options: Unlock advanced settings on your phone.
  • Enable USB Debugging: Allow your computer to communicate with the device.
  • Connect Device: Use a USB cable to connect your phone to your computer.
  • Run from Android Studio: Select your device and click the run button.
bash
adb devices
# Lists connected devices

# In Android Studio:
# 1. Connect device via USB
# 2. Click Run > Select your device
# 3. App installs and launches on device
Output
List of devices attached 0123456789ABCDEF device
๐Ÿ’ป

Example

This example shows how to run a simple Android app on your connected device using Android Studio.

text
1. Enable Developer Options on your Android device by tapping Build Number 7 times in Settings > About Phone.
2. Enable USB Debugging in Developer Options.
3. Connect your device to your computer with a USB cable.
4. Open your project in Android Studio.
5. Click the Run button (green triangle) in the toolbar.
6. Select your device from the list.
7. Android Studio installs and launches the app on your device.
Output
App launches on your Android device's screen
โš ๏ธ

Common Pitfalls

Here are common mistakes when running an app on a device:

  • Not enabling USB debugging causes device not to appear.
  • Using a faulty or charge-only USB cable prevents connection.
  • Not trusting the computer on the device when prompted.
  • Device drivers missing on Windows computers.

Always check these to avoid connection issues.

bash
Wrong:
# Trying to run app without enabling USB debugging
adb devices
# No devices listed

Right:
# Enable USB debugging and reconnect
adb devices
# Device listed
Output
Wrong output: List of devices attached Right output: List of devices attached 0123456789ABCDEF device
๐Ÿ“Š

Quick Reference

Summary tips for running Android apps on devices:

  • Enable Developer Options by tapping Build Number 7 times.
  • Turn on USB Debugging inside Developer Options.
  • Use a good USB data cable, not just charging cable.
  • Trust your computer when prompted on the device.
  • Install device drivers if needed (Windows).
  • Use Android Studio's device selector to run the app.
โœ…

Key Takeaways

Enable Developer Options and USB Debugging on your Android device before connecting.
Use a proper USB data cable and trust your computer when prompted on the device.
Select your device in Android Studio and click Run to install and launch the app.
Check device drivers on your computer if the device is not detected.
Common issues often come from missing USB debugging or faulty cables.