Know Your Android Tools: What Is ADB & How Do You Use It?
Anyone who has rooted their Android device has likely used a tool called Android Debug Bridge, better known as ADB, at some point during the process. For most, that is their only interaction with the ADB, but to be a true Android power user, you need to really know the tools at your disposal.Delving deeper into what ADB is and what it can do will help you to be more confident when modifying your device, as well as assist you in troubleshooting and fixing issues that you might experience along the way.
What Is ADB?ADB is a versatile command line tool that allows you to communicate with your device and accomplish a host of different tasks from your computer, such as transferring data, recording the screen's output to a video file, and running powerful shell commands.ADB is, as the name suggests, used primarily as a debug tool for Android developers. It is included in the Android SDK, or Software Development Kit.
How to Install ADBIf you only need ADB, downloading the entire Android SDK is overkill. Thankfully, it is possible to download and install the specific tools that we need in just a few easy steps, on all major operating systems.
Installing ADB on WindowsGetting ADB to work on Windows has always been a bit of an annoying task. Thankfully, XDA forums user Snoop05 created an installer that massively simplifies the process, by installing ADB and Fastboot (another useful tool), installing necessary device drivers, and adding these tools to your system PATH (allowing them to be run from any folder via the command line) into a 15-second operation.Simply download and run the installer. You will be asked if you want to install ADB and Fastboot—type "Y" and press enter. It will then ask if you want to install ADB system-wide—again, type "Y" and press enter. Next, it will ask if you want to install device drivers. Once again, type "Y" and press enter, which will open another installer for the drivers. Simply click "Next" and allow the drivers to install. Once the installation is complete, the installer will close and you are all done.
Installing ADB on Mac OS XIn the same vein as the Windows installer used above, scripts have been written for Mac OS X that massively simplify the ADB installation process. Please enable JavaScript to watch this video.
Follow the process in the above video and described here by Andrew to quickly install ADB and Fastboot on your Mac.
Installing ADB on Linux SystemsBy far the easiest installation process of them all. On many Linux distros, you will only need to issue a single command from the terminal:sudo apt-get install android-tools-adb android-tools-fastboot If for some reason that does not work, you may need to manually add a repository to APT, with this command:sudo add-apt-repository ppa:phablet-team/tools && sudo apt-get updateOnce that is complete, issue the first command again and it should install.Note: If you are using a flavor of Linux that does not use APT, you will need to look up the installation procedure for your specific package manager, though it should be fairly similar.
Configure Your Device to Work with ADBFirst, you need to enable developer options on your device. This is done by going to Settings -> About phone and tapping the Build number 7 times. You will now have Developer options available in the Settings menu. Enter Developer options and click the check box that says USB Debugging. A popup box will appear that asks you to confirm your choice. Next, attach your device to your computer via a USB cable. At this point you should get a popup that asks you if you would like to allow USB debugging from this computer. It will display your computer's RSA key fingerprint. Check the "Always allow from this computer" box and tap OK.Now open up the command prompt on your computer and type:adb devicesYou should see it list your device by its serial number with the word "device" next to it. If you do, ADB is properly configured and communicating with your device. If your device does not show up, you may have an issue with your drivers. Try completely uninstalling them in Device Manager and reinstalling.If, instead of device, it says "unauthorized" next to your serial number, make sure that you clicked "OK" on both Allow USB debugging boxes. If you have, try disconnecting and reconnecting your USB cable.
Basic ADB CommandsNow that ADB is installed and working properly, let's see what it can do.
Pushing Filesadb push <path-to-file> <device-destination>This command pushes a file from your computer to your device.Use-case: Pushing a ROM on to your phone when copying it over normally is not possible, for example, if your current ROM won't boot and you are stuck in recovery.Example: adb push sample.zip /sdcard/ This would send a file called sample.zip (in this case the file is in the current folder you are in when you issue the command) to the root of the SD card on your Android device.
Pulling Filesadb pull <path-to-file-on-device> <destination-path-on-computer>This command pulls a file from your device to your computer.Use-case: Pulling important files off of your device before performing a full wipe.Example: adb pull /sdcard/sample.zip C:\ This command copies a file called sample.zip from the root of the SD card to the root of my C drive.
Installing Appsadb install -r <path-to-APK-file>This command installs an APK file (an app) from your computer to your phone. The optional -r flag tells ADB to reinstall the app and keep existing data if it is already on your device. Using this method, the app will be installed very quickly, without any prompts displaying on the device itself.Use-case: Quickly installing apps that you have backed up on your computer.Example: adb install -r C:\AppBackups\NerdRage.apk This command installs an app located in a specific folder on my computer to my device, silently. If you watch the phone, nothing seems to happen, there are no popups or notifications displayed, the app just appears in your app drawer.
Loggingadb logcatThis command displays a real-time stream of your device's log on your computer. However, raw logcat output is not very helpful as it is very difficult to sort through, and continues to stream until you stop it (Ctrl+C). Thankfully, logcat output can easily be filtered in a number of useful ways, though a discussion of that is outside the scope of this tutorial.Use-case: You are troubleshooting an app you built or you are an awesome end user assisting a developer to troubleshoot their app.
Advanced TechniquesHere are a couple of advanced ADB commands that you can use to do some really cool things.
Enter Your Device's Shelladb shell <command>This command executes a single shell command.adb shellThis command opens a remote shell on your computer, allowing you to enter multiple commands. Interacting with your device's shell is identical to navigating the terminal in Linux in terms of command syntax, however, your device has a significantly smaller set of commands available to you. If you would like more command line tools at your disposal, try installing Busybox.The shell gives you access to a very wide variety of functions, however, most shell commands of any consequence will require your phone to be rooted to run. In addition, playing around in the shell with root access can be disastrous if you don't know what you are doing, so exercise caution.Use-case: Too many to list.Example: adb shell pm list packages -f This command displays all the packages (apps) currently installed on your device.Example: adb shell top This command runs a binary called "top" that displays running processes and their CPU and memory usage.These are just a couple of very basic examples—when it comes to the shell, the sky's the limit and people are constantly coming up with new uses for this functionality.
Recording Your Screen's Output to a Video FileThis feature is new to Android 4.4 KitKat. It allows users to record screen activity to an MPEG-4 file, which you can then download.adb shell screenrecord <path-on-device-to-save-video-to>Running this command will start a screen recording that is saved locally on your device. The recording will continue until you stop it by hitting Ctrl+C, or automatically after three minutes of recording.Use-case: Creating a video presentation that involves using your Android device.Example: adb shell screenrecord /sdcard/Demo.mp4 The video file that is created displays smoothly, and the actual act of recording the screen does not seem to adversely affect device performance.This method of screen recording does have some limitations, for example, it cannot record audio, and doesn't yet support screen rotation. You can see more on screen recording in KitKat with this guide from Neil.
ConclusionNow that you know what ADB is, and what you can do with it, go out and conquer the command line with confidence.Next time, we will take an in depth look into that other command line tool we installed at the outset, fastboot. And as always, let your comments and questions fly in the section below.
I morges udgav Google et nyt projekt, der var passende benævnt Google Art Project. Dette nye online-værktøj sætter over 1000 kunstværker lige ved hånden. Og vi taler ikke Google Image Search. Kunstprojektet giver ekstraordinære detaljer for nogle af verdens mest kendte malerier.
Google's Art Project Chrome Extension brings masterpieces
How to Make Dyson Fan at Home: The smooth breeze of air flowing through a good looking small table fan placed on your work desk feels wonderful while working. The problem with most table fans is that they provide random flows of air rather than continuous breeze.
What are some examples of everyday items that use motors? - Quora
When Google introduced the Pixel 3 on October 9th, one of new additions they briefly mentioned was the Titan M security chip. While they did talk about how it will improve overall security, they didn't expand on the number of changes it brings to the Pixel 3's security.
Titan M makes Pixel 3 our most secure phone yet - blog.google
The Galaxy Note 3 is finally out and if you have already got your hands on this device, it's highly recommended that you backup its EFS data before involving in any custom development activity. Please be noted that you can get back lost IMEI (International Mobile Equipment Identity) number on your Note 3 only if you have a backup.
Samsung Galaxy Note 9: Backup/Restore EFS and IMEI Partitions
HOW TO BUILD A ONE-STRING DIDDLEY BOW IN 20 MINUTES! In this video Justin Johnson and Blind Kiwi teach how to build and play a one-string guitar (diddley bow) in under 20 minutes, with just a
How to Build a simple one-string electric guitar called a
It is better to have enabled hibernation for all settings, because this mode will automatically hibernate only currently active settings. You can apply settings hibernation to: wifi, mobile data (APN), bluetooth (BT) Applications hibernation Choose which battery-draining apps will be disabled (hibernated) when the screen is OFF.
Windows 10 Battery - New Features and Tips to Significantly
With profiles, you can keep all your Chrome info separate, like bookmarks, history, passwords, and other settings. Profiles are ideal for: Sharing a computer with multiple people. Keeping your different accounts, like work and personal, separate. What others can see when you share Chrome. Only share your device with people you trust.
The Music App gets a complete redesign in iOS 8.4 [Hands-on video] Posted by Cody on Apr 18, 2015 in Featured , iOS 8.4, iOS 8.4.1 iOS 8.4 beta which was seeded to developers few days back comes with an all-new Music app .
How to Add Ambient Album Art to Your Lock Screen When
Instagram has updated with new feature which is called activity. In this the people can able to see the last seen and active status of the user by which people can identify who are ignoring. where as the Instagram has also update how to hide that
How do I unfriend or remove a friend? | Facebook Help Center
The best way to block ads on Chrome is to use a system-level ad blocker. Not only will it help you get rid of annoying pop-up ads, but it will also remove all other ad formats from your internet experience. Imagine browsing, using social media, and watching videos on YouTube without intrusive ads trying to catch your attention at any cost.
4 Ways to Block Ads on Google Chrome - wikiHow
Microsoft likes tiles and wants you to like them, too. They've been around since Windows 8 and live on in Windows 10, even with the return of the Start menu. Whether you love tiles or not, you can
Windows 10 - Managing App Tiles - ccm.net
How to Bypass a Firewall or Internet Filter. This wikiHow teaches you how to view blocked websites or content on a restricted computer, as well as on a mobile item if you're using a Virtual Private Network (VPN).
Read articles behind paywalls by masquerading as Googlebot
Learn how to remove Music Player from the lock screen on iPhone in iOS 11. You can also leave your comments on this blog post
0 comments:
Post a Comment