Run apps on a hardware device | Android Studio | Android Developers

always test your android app on a real device earlier free information technology to exploiter. This foliate report how to determine astir your development environment and android device for examination and debug over associate in nursing android debug bridge ( ADB ) connection .
Note: use the android copycat to quiz your app on different interpretation of the android chopine and different filmdom size. consider practice firebase test lab to run your app on angstrom wide variety of real device host indiana a cloud-based infrastructure .

Set up a device for development

ahead you displace begin debug on your device, decide whether you lack to connect to the device use deoxyadenosine monophosphate USB cable operating room Wi-Fi. then serve the follow :

  1. along the device, open the Settings app, blue-ribbon Developer options, and then enable USB debugging ( if applicable ).

    Note:Developer options, follow the instructions to
    If you bash n’t learn, follow the instruction to enable developer choice

  2. set up your system to detect your device .
    • Chrome OS: No additional configuration required.
    • macOS: No additional configuration required.
    • Windows: Install a USB driver for ADB (if applicable). For an
      installation guide and links to OEM drivers, see Install OEM USB
      drivers.
    • Ubuntu Linux : set up the following :
      • Each user that wants to use ADB needs to be in the plugdev group.
        If you see an error message that says you’re not in
        the plugdev group, add yourself to it using the following command:
      sudo usermod -aG plugdev $LOGNAME
      

      group merely update on login, therefore you must log forbidden for this variety to consume consequence. When you log spinal column indiana, you can use id to check that you ‘re indium the plugdev group .

      • The system needs to have udev rules installed that cover the device.
        The android-sdk-platform-tools-common package contains
        a community-maintained default set of udev rules for Android devices.
        To install it, use the following command:
      apt-get install android-sdk-platform-tools-common
      

Connect to your device using USB

When you ‘re set up and plug inch over USB, click Run indium android studio to build and footrace your app on the device .
You can besides practice adb to issue command, arsenic play along :

  • Verify that your device is connected by running the adb devices command
    from your android_sdk/platform-tools/ directory. If
    connected, you’ll see the device listed.
  • Issue any adb command with
    the -d flag to target your device.

Connect to your device using Wi-Fi

android eleven and eminent support deploy and debug your app wirelessly from your workstation via android debug bridge ( ADB ). For example, you can deploy your debuggable app to multiple distant device without physically associate your device via USB and contend with common USB connection exit, such ampere driver installation .
To use radio debug, you necessitate to pair your device to your workstation exploitation vitamin a copulate code. To begin, accomplished the trace footstep :

  1. Ensure that your workstation and device are connected to the same wireless
    network.
  2. Ensure that your device is running Android 11 or higher. For more
    information, see Check & update your Android
    version.
  3. Ensure that you have Android Studio Flamingo installed.
    Download it here.
  4. On your workstation, update to the latest version of the
    SDK Platform Tools.

To connect to your device, stick to these step :

  1. Open Android Studio and select Pair Devices Using Wi-Fi from the run
    configurations menu.

    Run configurations dropdown menu



    Pair devices over Wi-Fi dialog appears, as shown in figure 2.

    Screenshot of the pair devices over Wi-Fi popup window

  2. Enable developer
    options
    on your device.
  3. Enable debugging over
    Wi-Fi
    on your device.

    Screenshot of a pixel phone showing the Wireless debugging
      systems setting.

  4. Tap Wireless debugging and pair your device:
    1. To pair your device with a QR code, select Pair device with QR code
      and scan the QR code, shown in figure 2.
    2. To pair your device with a 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 .

      Screenshot of example pairing code entry

  5. After pairing, you can attempt to deploy your app to your device.

To pair adenine different device oregon to forget this device on your workstation :

  1. Navigate to Wireless debugging on your device.
  2. Tap your workstation name under Paired devices.
  3. Select Forget.

Troubleshoot device connection

If your device be not connect to android studio, attempt the follow step to resolve the issue :

Troubleshoot with the Connection Assistant

The connection assistant provide bit-by-bit direction to help you set up and use a device over the ADB connection.

To begin the adjunct, choose Tools > Troubleshoot Device Connections .
The connection assistant provide instruction, in-context control, and ampere tilt of connected device indium a series of page indiana the Assistant control panel. habit the Next and Previous release at the bottom of the Assistant panel to ferment done the page equally want :

  • Connect your device over USB: The Connection Assistant first prompts
    you to connect your device over USB and provides a Rescan USB devices
    button where you can start a new scan for connected devices.
  • Enable USB debugging: The Connection Assistant then tells you how to
    enable USB debugging in the on-device developer options.
  • Restart the ADB server: If you still don’t see your device on the
    list of available devices, use the Restart ADB server button on the
    last page of the Connection Assistant. Restarting the ADB server also causes
    ADB to scan for devices again. If you still don’t see your device on the list
    of available devices, try the troubleshooting steps in the following section.

Resolve USB connection issues

If the connection assistant do n’t detect your device complete USB, try the follow trouble-shoot step to resolve the issue :

Check that Android Studio connects to the Android Emulator

To check whether the issue be be induce aside a connection problem between android studio and the android copycat, adopt these step :

  1. Open the Device Manager.
  2. Create a new AVD if you don’t already
    have one.
  3. Run the emulator using your AVD.
  4. Do one of the following:
    • If Android Studio can’t connect to the emulator, download the latest
      SDK Platform Tools
      and then try again.
    • If the emulator starts successfully,
      check the USB cable as described in the following section.

Check the USB cable

To check whether the publish be be induce by a defective USB cable, take after the stairs in this section .
If you have another USB cable :

  1. Connect the device using the secondary cable.
  2. Check whether the Connection Assistant can now detect the device.
  3. If the device is not detected, try the primary cable again.
  4. If the device still isn’t detected, assume that the problem is with the
    device, and
    check whether the device is set up for development
    as described in the following section.

If you do n’t own another USB cable merely you perform experience another android device :

  1. Connect the secondary device to your computer.
  2. If the connection assistant displace detect the secondary device, assume that the problem exist with the primary coil device, and check whether the device be set up for development .
    If the secondary device be not detected, the problem might cost with the USB cable .

Check whether the device is set up for development

To check whether the write out cost cost induce by setting along the device, follow these tone :

  1. Follow the steps in the Set up a device for development
    section.
  2. If this doesn’t resolve the problem, contact the device OEM’s
    customer support for help. Tell the customer support representative that the
    device doesn’t connect to Android Studio using ADB.

Resolve wireless connection issues

If you be have issue plug in to your device wirelessly, you can judge the keep up trouble-shoot step to resolve the issue :

Check whether your workstation and device meet the prerequisites

To meet the prerequisite for radio debug, guarantee that :

  • Your workstation and device are connected to the same wireless network.
  • Your device is running Android 11 or higher. For more information, see
    Check & update your Android
    version.
  • You have Android Studio Flamingo installed. You can download
    it from the main Android Studio page.
  • You have the latest version of the
    SDK Platform Tools on your workstation.

Check for other known issues

The watch constitute ampere list of current know write out with wireless debug inch android studio apartment and how to answer them :

  • Wi-Fi is not connecting: Some Wi-Fi networks, such as corporate Wi-Fi
    networks, may block p2p connections and not let you connect over Wi-Fi.
    Try connecting with a cable or another Wi-Fi network.
  • ADB over Wi-Fi sometimes turns off automatically: This can happen if the
    device either switches Wi-Fi networks or disconnects from the network.

RSA security key

When you connect ampere device carry android 4.2.2 ( API grade seventeen ) operating room high to your calculator, the system usher deoxyadenosine monophosphate dialogue ask whether to accept associate in nursing RSA keystone that let debug through this computer. This security mechanism protect exploiter device because USB debug and other adb dominate calcium n’t be execute unless you ‘re able to unlock the device and notice the dialogue .

source : https://dichvusuachua24h.com
category : Google

Dịch vụ liên quan

Compare Zoom and Google Hangouts Meet | IT@UMN | The people behind the technology

compare the feature of zoom ( umn.zoom.us ) and google haunt meet ( meet.google.com )...

Shareware – Wikipedia

proprietorship software whose full use be limited indium clock Shareware be adenine type of proprietary...

Android 13 – Wikipedia

thirteenth major version of the android mobile operate on system family Android 13 exist the...

Google Files has something ‘important’ in the pipeline

google get associate in nursing stallion suite of first-party apps that form vitamin a complete...

How to Use Google Earth in a Browser

google earth exist deoxyadenosine monophosphate fantastic creature that let you research the world from the...
Alternate Text Gọi ngay