Don’t Miss: 50 Best Apps for Rooted Android Devices. Adb get-serialno. Displays the adb instance serial number string with the device. Shows the status of the device. Adb wait-for-device. This command is used to program delay before the next command is issued. This can be done either via button combination which differs from device to device or the easy method over adb command. Adb reboot fastboot Step 2. Fastboot oem writeimei 12347 Step 3. Verify that the IMEI has changed successfully run: fastboot getvar imei. Which should show the actual IMEI of the device. Target a device by serial number Use the -s option followed by a device name to select on which device the adb command should run. The -s options should be first in line, before the command.
My Android-Phone is locked because I put too many wrong patterns. When a wrongpattern is entered too often, your device is locked and asking to unlock it viagoogle. You are a lucky guy, if it is locked with Wifi or data network on and ofcourse you remember your google username and password. But if not, you have twopossible solutions:1. hard reset your device.2. use adb commands.
If you use number 1 all your data are gone. Maybe you can restore it with a backup.
To use 2 you have to have enabled USB Debugging on the device before it islocked. If you have, and I have it always enabled on all my android devices, youcan use the following solution to unlock your device.
- PC or Laptop with a working OS on it (I use OSX, but it is working also on Unix and Windows)
- Android SDK. You can get it at the developer site.
- Connected android device via usb to your PC
To run the adb-commands you have to change to the platform-tools
directory inyour android-sdk (/path/to/your/android-sdk/platform-tools
).
Now you can use the following commands
Now your device is unlocked. If not use adb shell rm /data/system/gesture.key
.
I cleared lock patterns and removed the permanent lock from database. I havebroken the security to unlock my device, but I saved my device and all data andI can use it again.
-->This article explains how to setup an Android device and connect it to a computer so that the device may be used to run and debug Xamarin.Android applications.
After testing on an Android emulator, you will want to see and test your apps running on an Android device. You will need to enable debugging and connect the device to the computer.
Each of these steps will be covered in more detail in the sectionsbelow.
Enable Debugging on the Device
A device must be enabled for debugging in order to test an Androidapplication. Developer options on Android have been hidden by defaultsince version 4.2, and enabling them can vary based on the Androidversion.
Android 9.0+
For Android 9.0 and higher, debugging is enabled by followingthese steps:
- Go to the Settings screen.
- Select About Phone .
- Tap Build Number 7 times until You are now a developer! is visible.
Android 8.0 and Android 8.1
- Go to the Settings screen.
- Select System.
- Select About Phone
- Tap Build Number 7 times until You are now a developer! is visible.
Android 7.1 and lower
- Go to the Settings screen.
- Select About Phone.
- Tap Build Number 7 times until You are now a developer! is visible.
Verify that USB debugging is enabled
After enabling developer mode on your device, you must ensure that USB debuggingis enabled on the device. This also varies based on the Android version.
Android 9.0+
Navigate to Settings > System > Advanced > Developer Options and enable USB Debugging.
Android 8.0 and Android 8.1
Navigate to Settings > System > Developer Options and enable USB Debugging.
Android 7.1 and lower
Navigate to Settings > Developer Options and enable USB Debugging.
Once the Developer Options tab is available under Settings >System, open it to reveal developer settings:
This is the place to enable developer options such as USB debugging andstay awake mode.
Connect the device to the computer
The final step is to connect the device to the computer. The easiest andmost reliable way is to do so over USB.
You will receive a prompt to trust the computer on your device if you havenot used it for debugging before. You can also check Always allow from thiscomputer to prevent requiring this prompt each time you connect the device.
Alternate connection via Wifi
It is possible to connect an Android device to a computer without using a USB cable, over WiFi. This technique requires more effort but could be useful when the device is too far from the computer to remain constantly plugged-in via cable.
Connecting over WiFi
By default, theAndroid Debug Bridge (ADB)is configured to communicate with an Android device via USB. It ispossible to reconfigure it to use TCP/IP instead of USB. Todo this, both the device and the computer must be on the same WiFinetwork. To setup your environment to debug over WiFi complete the following stepsfrom the command line:
Determine the IP address of your Android device. One way to findout the IP address is to look under Settings > Network & internet > Wi-Fi,then tap on the WiFi network that the device is connected to, and then tap onAdvanced. This will open a dropdown showing information about the networkconnection, similar to what is seen in the screenshot below:
On some versions of Android the IP address won't be listed therebut can be found instead under Settings > About phone > Status.
Connect your Android device to your computer via USB.
Next, restart ADB so that it using TCP on port 5555. From a commandprompt, type the following command:
After this command is issued, your computer will not be able to listen to devices that are connected via USB.
Disconnect the USB cable connecting your device to your computer.
Configure ADB so that it will connect to your Android device on the port that was specified in step 1 above:
Once this command finishes the Android device is connected to the computer via WiFi.
When you're finished debugging via WiFi, it's possible to reset ADB back toUSB mode with the following command:
It's possible to request ADB to list the devices that are connected to thecomputer. Regardless of how the devices are connected, you can issuethe following command at the command prompt to see what is connected:
Troubleshooting
In some cases you might find that your device cannot connect to the computer. In this case you may want to verify that USB drivers are installed.
Install USB Drivers
This step is not necessary for macOS; just connect the device to theMac with a USB cable.
It may be necessary to install some extra drivers before a Windowscomputer will recognize an Android device connected by USB.
Note
These are the steps to set up a Google Nexus deviceand are provided as a reference. Steps for your specific device mayvary, but will follow a similar pattern. Search the internet for yourdevice if you have trouble.
Run the android.bat application in the [Android SDK install path]toolsdirectory. By default, the Xamarin.Android installer will put theAndroid SDK in following location on a Windows computer:
C:Users[username]AppDataLocalAndroidandroid-sdk
Download the USB Drivers
Google Nexus devices (with the exception of the Galaxy Nexus) requirethe Google USB Driver. The driver for the Galaxy Nexus isdistributed by Samsung.All other Android devices should use theUSB driver from their respective manufacturer.
Install the Google USB Driver package by starting the Android SDKManager, and expanding the Extras folder, as can be seen in thefollow screenshot:
Adb Change Device Settings
Check the Google USB Driver box, and click the Apply Changes button.The driver files are downloaded to the following location:
[Android SDK install path]extrasgoogleusb_driver
The default path for a Xamarin.Android installation is:
C:Users[username]AppDataLocalAndroidandroid-sdkextrasgoogleusb_driver
Installing the USB Driver
After the USB drivers are downloaded, it is necessary to install them.To install the drivers on Windows 7:
Connect your device to the computer with a USB cable.
Right-click on the Computer from your desktop or Windows Explorer,and select Manage .
Select Devices in the left pane.
Locate and expand Other Devices in the right pane.
Right-click the device name and select Update Driver Software .This will launch the Hardware Update Wizard.
Select Browse my computer for driver software and clickNext .
Click Browse and locate the USB driver folder (the Google USBdriver is located in [Android SDK install path]extrasgoogleusb_driver).
Click Next to install the driver.
Summary
Adb Change Devices
This article discussed how to configure an Android device fordevelopment by enabling debugging on the device. It also covered how toconnect the device to a computer using either USB or WiFi.