Skip to main content
There are multiple ways to run the TechSales Android application: through Android Studio, using ADB commands, or via Gradle tasks.

Running from Android Studio

The easiest way to run TechSales is through Android Studio:
1

Open Project

Open the TechSales project in Android Studio
2

Select Device

Choose a target device from the device dropdown:
  • Physical device connected via USB
  • Android Virtual Device (AVD) emulator
3

Run

Click the Run button (green play icon) or press Shift + F10Android Studio will:
  • Build the debug APK
  • Install it on the selected device
  • Launch the MainActivity

Running with Gradle

Use Gradle tasks to build, install, and optionally launch the app:

Install Debug Build

./gradlew installDebug
This builds and installs the debug APK on all connected devices.

Install Release Build

./gradlew installRelease
Release builds require signing configuration. The unsigned APK must be signed before installation on production devices.

Uninstall App

To remove the app from connected devices:
./gradlew uninstallDebug
# or
./gradlew uninstallRelease

Running with ADB

Android Debug Bridge (ADB) provides direct control over app installation and launching.

Prerequisites

Ensure ADB is in your PATH and devices are connected:
adb devices

Install APK

First, build the APK (see Building), then install it:
# Install debug build
adb install app/build/outputs/apk/debug/app-debug.apk

# Install release build
adb install app/build/outputs/apk/release/app-release-unsigned.apk

# Reinstall (keep app data)
adb install -r app/build/outputs/apk/debug/app-debug.apk

Launch the App

Launch the MainActivity using the package name and activity:
adb shell am start -n com.teamtech.techsales/.MainActivity
Package name: com.teamtech.techsales
Main activity: MainActivity
The activity reference .MainActivity is shorthand for com.teamtech.techsales.MainActivity.

Combined Install and Launch

# Build, install, and launch in one command
./gradlew installDebug && adb shell am start -n com.teamtech.techsales/.MainActivity

Stop the App

adb shell am force-stop com.teamtech.techsales

Uninstall via ADB

adb uninstall com.teamtech.techsales

Setting Up an Emulator

To run TechSales on an Android Virtual Device (AVD):
1

Open AVD Manager

In Android Studio, go to Tools > Device Manager
2

Create Virtual Device

Click Create Device and select a device profile (e.g., Pixel 6)
3

Select System Image

Choose a system image matching the app’s requirements:
  • Minimum API: 29 (Android 10)
  • Target API: 36
Recommended: Use API level 29 or higher
4

Configure AVD

Set AVD name and advanced settings:
  • RAM: At least 2GB
  • Internal storage: 2GB+
  • Graphics: Hardware acceleration
5

Launch Emulator

Click the play button next to your AVD in the Device Manager

Launch Emulator from Command Line

# List available emulators
emulator -list-avds

# Launch specific emulator
emulator -avd <avd_name>

Device Debugging

Enable USB Debugging

To run on a physical device:
1

Enable Developer Options

On your Android device:
  1. Go to Settings > About phone
  2. Tap Build number 7 times
2

Enable USB Debugging

  1. Go to Settings > System > Developer options
  2. Enable USB debugging
3

Connect Device

Connect your device via USB and authorize the computer when prompted
4

Verify Connection

Check device is recognized:
adb devices
You should see your device listed

Wireless Debugging (Android 11+)

For devices running Android 11 or higher:
# Enable wireless debugging in Developer Options
# Then connect via IP:
adb connect <device-ip>:5555

View Logs

Monitor app logs in real-time:
# View all logs
adb logcat

# Filter by package name
adb logcat | grep com.teamtech.techsales

# Filter by tag
adb logcat -s TechSales

Application Entry Point

The app launches through the MainActivity, as defined in AndroidManifest.xml:
<activity
    android:name=".MainActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
  • Activity class: com.teamtech.techsales.MainActivity
  • Exported: true (required for launcher)
  • Intent filter: MAIN/LAUNCHER (shows in app drawer)

Quick Reference

Common ADB Commands

# List connected devices
adb devices

# Install APK
adb install <path-to-apk>

# Reinstall APK (keep data)
adb install -r <path-to-apk>

# Launch app
adb shell am start -n com.teamtech.techsales/.MainActivity

# Stop app
adb shell am force-stop com.teamtech.techsales

# Uninstall app
adb uninstall com.teamtech.techsales

# View logs
adb logcat

# Clear app data
adb shell pm clear com.teamtech.techsales

Gradle Run Tasks

# Build and install debug
./gradlew installDebug

# Build and install release
./gradlew installRelease

# Uninstall debug
./gradlew uninstallDebug

# Uninstall release
./gradlew uninstallRelease

Troubleshooting

Device Not Recognized

  1. Check USB cable and connection
  2. Enable USB debugging on device
  3. Authorize computer on device
  4. Restart ADB server:
    adb kill-server
    adb start-server
    

Installation Failed

# Uninstall existing version first
adb uninstall com.teamtech.techsales

# Then reinstall
./gradlew installDebug

App Crashes on Launch

Check logs for errors:
adb logcat | grep AndroidRuntime

Next Steps

Testing

Run tests to verify functionality

Building

Learn about build variants

Build docs developers (and LLMs) love