Package Manager Not Started Yet Trying Again in When Trying to Deploy App to Phone
When building an Android app, it's important that you always examination your app on a real device earlier releasing it to users. This page describes how to fix up your development surround and Android device for testing and debugging over an Android Debug Bridge (ADB) connection.
Ready a device for development
Before you can start debugging on your device, decide if you want to connect the device to using a USB cable or Wi-Fi. Then do the following:
-
On the device, open the Settings app, select Developer options, and then enable USB debugging (if applicable).
-
Set up your organisation to detect your device.
- Chrome Bone: No additional configuration required.
- macOS: No additional configuration required.
-
Ubuntu Linux: There are ii things that need to be set up correctly: each user that wants to use adb needs to be in the plugdev group, and the system needs to have udev rules installed that encompass the device.
plugdev group: If y'all run across an mistake message that says yous're not in the plugdev grouping, you'll need to add yourself to the plugdev group:
sudo usermod -aG plugdev $LOGNAME
Note that groups only go updated on login, and so you'll need to log out for this change to accept effect. When you log dorsum in, you can use
id
to check that you're at present in the plugdev group.udev rules: The
android-sdk-platform-tools-common
package contains a community-maintained default set of udev rules for Android devices. To install:apt-get install android-sdk-platform-tools-common
-
Windows: Install a USB commuter for ADB (if applicable). For an installation guide and links to OEM drivers, see the Install OEM USB drivers document.
Connect to your device using USB
When yous are set up up and plugged in over USB, you can click Run in Android Studio to build and run your app on the device.
You can also utilize adb to outcome commands, as follows:
- Verify that your device is connected past running the
adb devices
command from yourandroid_sdk/platform-tools/
directory. If connected, you'll see the device listed. - Event any adb command with the
-d
flag to target your device.
Connect to your device using Wi-Fi
Android 11 (and afterwards) supports deploying and debugging your app wirelessly from your workstation via Android Debug Bridge (adb). For instance, you can deploy your debuggable app to multiple remote devices without physically connecting your device via USB and contending with common USB connection problems, such as commuter installation.
To use wireless debugging, you need to pair your device to your workstation using a pairing code. To begin, consummate the post-obit steps:
- Ensure that your workstation and device are connected to the aforementioned wireless network.
- Ensure that your device is running Android 11 or higher. For more informaton, see Cheque & update your Android version.
- Ensure that you have Android Studio Bumblebee Canary. You can download information technology here.
- On your workstation, update to the latest version of the SDK Platform-Tools.
To connect to your device, follow these steps:
- Open up Android Studio and select Pair Devices Using Wi-Fi from the run configurations dropdown carte.
- Enable programmer options on your device.
- Enable debugging over Wi-Fi on your device.
- Tap on Wireless debugging and pair your device:
- To pair your device with a QR code, select Pair device with QR code and scan the QR code obtained from above.
- To pair your device with a pairing code, select Pair device with pairing code from the Pair devices over Wi-Fi window higher up. On your device, select Pair using pairing code and take note of the 6 digit pivot code. In one case your device appears on the Pair devices over Wi-Fi window, you can select Pair and enter the six digit pivot lawmaking shown on your device.
-
After yous are paired, you tin endeavour to deploy your app to your device.
To pair a dissimilar device or to forget this device on your workstation, navigate to Wireless debugging on your device, tap on your workstation proper name under Paired devices, and select Forget.
Troubleshoot device connection
If your device is not connecting to Android Studio, try the following to resolve the issue.
Troubleshoot with the Connexion Assistant
The Connexion Banana provides pace-by-step instructions to help you set upwardly and use a device over the ADB connectedness.
To offset the assistant, choose Tools > Troubleshoot Device Connections.
The Connection Assistant provides instructions, in-context controls, and a list of connected devices in a series of pages in the Banana panel. Utilize the Next and Previous buttons at the bottom of the Banana panel to work through the pages every bit needed:
- Connect your device over USB: The Connection Assistant begins by prompting you to connect your device over USB, and it provides a Rescan USB devices button with which you tin 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 programmer options.
- Restart the ADB server: Finally, if you all the same don't see your device on the list of available devices, you lot can use the Restart ADB server push on the last page of the Connection Assistant. Restarting the ADB server too causes ADB to scan for devices again. If you however don't see your device on the listing of available devices, endeavor the troubleshooting steps in the side by side section of this folio.
Resolve USB connection issues
If the Connexion Assistant is non detecting your device over USB, you can try the following troubleshooting steps to resolve the upshot:
Check that Android Studio tin connect to the Android Emulator
To check if the outcome is being acquired past a connectedness problem between Android Studio and the Android Emulator, follow these steps:
- Open up the AVD Manager.
- Create a new AVD if you don't already have one.
- Run the emulator using your AVD.
- Do one of the following:
- If Android Studio can't connect to the emulator, download the latest SDK Platform Tools and then try once more.
- If the emulator starts successfully, cheque the USB cable.
Check the USB cable
To bank check if the result is being caused by a faulty USB cable, follow the steps in this department.
If you have another USB cable:
- Connect the device using the secondary cable.
- Check if the Connexion Assistant can now detect the device.
- If the device is non detected, try the primary cable again.
- If the device still isn't detected, assume that the problem is with the device and check if the device is set upwardly for development.
If you don't have some other USB cable but you do accept another Android device:
- Connect the secondary device to your computer.
-
If the Connexion Banana tin detect the secondary device, presume that the trouble is with the primary device and bank check if the device is gear up for evolution.
If the secondary device is non detected, the problem might be with the USB cable.
Check if the device is ready up for development
To check if the event is being caused by settings on the device, follow these steps:
- Follow the steps in the Prepare up a device for development section.
- If this does not resolve the trouble, contact the device OEM's customer support for help. Tell the customer support representative that the device won't connect to Android Studio using ADB.
Resolve wireless connectedness issues
If you are having problems connecting to your device wirelessly, you can endeavor the following troubleshooting steps to resolve the outcome.
Check if your workstation and device meet the prerequisites
To meet the prerequisites for wireless debugging, ensure that:
- Your workstation and device are continued to the same wireless network.
- Your device is running Android eleven or college. For more information, see Cheque & update your Android version.
- You have Android Studio Bumblebee. Y'all can download it here.
- You have the latest version of the SDK Platform Tools on your workstation.
Check for other known issues
The following is a listing of current known bug with wireless debugging in Android Studio and how to resolve them.
- Wi-Fi is non connecting: Some Wi-Fi networks, such as corporate Wi-Fi networks, may block p2p connections and non allow you to connect over Wi-Fi. Try connecting with a cable or some other Wi-Fi network.
- ADB over Wi-Fi sometimes turns off automatically: This tin happen if the device either switches Wi-Fi networks or disconnects from the network.
RSA security cardinal
When yous connect a device running Android 4.ii.2 (API level 17) or college to your calculator, the arrangement shows a dialog asking whether to have an RSA key that allows debugging through this estimator. This security machinery protects user devices considering it ensures that USB debugging and other adb commands cannot be executed unless you lot're able to unlock the device and admit the dialog.
Source: https://developer.android.com/studio/run/device
0 Response to "Package Manager Not Started Yet Trying Again in When Trying to Deploy App to Phone"
Post a Comment