Scrcpy uses adb to communicate with the device, and adb can connect to a device over TCP/IP: Connect the device to the same Wi-Fi as your computer. Get your device IP address (in Settings → About phone → Status). Enable adb over TCP/IP on your device: adb tcpip 5555. Unplug your device.
- Android SDK Platform Tools download is now available as a zip file directly from Google. Just download the latest SDK platform-tools zip containing ADB and Fastboot binaries for Windows, Mac, and Linux from below and unzip it.
- Debian-based Linux users can type the following command to install ADB: sudo apt-get install adb; Fedora/SUSE-based Linux users can type the following command to install ADB: sudo yum install android-tools; You have given Windows, Mac iOS, and Linux Android.
The Android Debug Bridge (ADB) is a versatile command line tool that lets you communicate with and control an Android-powered device over a USB link from a computer. It comes along with other useful tools and code bundled with the Android Software Development Kit (SDK).
The ADB program includes three components:
- A client, which runs on your development machine. You can invoke a client from a shell by issuing an
adb
command. Other Android tools such as the ADT plugin and DDMS also create adb clients. - A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
- A daemon, which runs as a background process on each emulator or device instance.
Setting Up ADB
On Windows and Linux
If you installed the Android SDK, the Android Debug Bridge will already be installed along with it. Otherwise, follow our guide on installing the Android SDK.
On Mac
If you have already downloaded the Android SDK, launch the SDK Manager by typing into a Terminal window:
<sdk>/tools/android
where <sdk>
is the path to the tools directory. For example, if the Android SDK is located on the desktop, then you have to type into the terminal window:
/Users/MyName/Desktop/android-sdk-mac_86/tools/android
As soon as the SDK Manager is launched, click “Available packages”, then “Android Repository.” When the list of available packages pops up, choose the offered revision of “Android SDK Platform-tools”. Click “Install Selected.” If it is installed, the adb executable binary will be located in the platform-tools
subdirectory.
If you don’t have the Android SDK installed yet, download its latest version and unzip it into an appropriate destination folder then follow the instructions above.
We want to make sure that ADB is now working. First, see to it that your Android device is set up for debugging. On your Android device running Gingerbread, go to the Settings > Applications > Development screen and make sure “USB Debugging” is checked. If you’re already on Ice Cream Sandwich, go to Settings > Developer options and tick “Android debugging” or “USB debugging.”
Connect your computer and Android device with a USB cable. Then, open a terminal on your computer and run the following command:
adb devices
You should see something like this:
List of devices attached
XXXXXXXXXXXX device
A result like that (where the X’s represent your device’s actual serial number) confirms that your ADB is set up and working.
Learning the Codes
Now that ADB is already set up on your machine, you might want to know how to use its various flags and command options.
Flags
- -d
- directs command to the only connected USB device; returns an error if more than one USB device is present.
- -e
- directs command to the only running emulator; returns an error if more than one emulator is running.
- -s <serial number>
- directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.
- -p <product name or path>
- simple product name like ‘sooner’, or a relative/absolute path to a product out directory like ‘out/target/product/sooner’. If
-p
is not specified, the ANDROID_PRODUCT_OUT environment variable is used, which must be an absolute path. - devices
- list all connected devices
- connect <host>:<port>
- connect to a device via TCP/IP
- disconnect <host>:<port>
- disconnect from a TCP/IP device
Commands
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid>
(remote only)
-l
means forward-lock the app-r
means reinstall the app, keeping its data-s
means install on SD card instead of internal storage
-k
means keep the data and cache directories)Data Options
Adb Android Mac Terminal
DATAOPTS:
- (no option)
- don’t touch the data partition
- -w
- wipe the data partition
- -d
- flash the data partition
Scripting
- adb wait-for-device
- block until device is online
- adb start-server
- ensure that there is a server running
- adb kill-server
- kill the server if it is running
- adb get-state
- prints: offline | bootloader | device
- adb get-serialno
- prints: <serial-number>
- adb status-window
- continuously print device status for a specified device
- adb remount
- remounts the /system partition on the device read-write
- adb reboot [bootloader|recovery]
- reboots the device, optionally into the bootloader or recovery program
- adb reboot-bootloader
- reboots the device into the bootloader
- adb root
- restarts the adbd daemon with root permissions
- adb usb
- restarts the adbd daemon listening on USB
- adb tcpip <port>
- restarts the adbd daemon listening on TCP on the specified port
Networking
<tty>
refers to the tty for PPP stream. Eg.dev:/dev/omap_csmi_tty1
[parameters]
– Eg.defaultroute debug dump local notty usepeerdns
Sync
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is “system” or “data”, only the corresponding partition is updated.
Once you already have ADB set up and functioning on your computer, you can start using it for a lot of important Android-related tasks, such as creating Android apps, debugging Android apps, and rooting your Android phone. Check out our how-to guides for rooting your Android phones.
Android ADB and Fastboot on Mac:
Contents
- 1 Steps to Install Android ADB and fastboot on Mac
ADB
ADB stands for Android Debug Bridge which lets you communicate with the device (device is connected via USB cable). It can perform a variety of operations, i.e., enabling recovery mode, installation of zip files, etc. which can’t be processed by the normal user interface. Mostly the advanced users use this tool for twisting the device or to install different firmware on their devices.
Fastboot
Fastboot is a system protocol that can be used for modifying the system images of the Android device. In some of the devices like Nexus it comes automatically turn on by default, and on other devices, you have to do manual operations to turn it on. It supports Windows, Linux, and Mac systems. Like ADB it is similar to the client-server program, includes three things at the same time which are as follows:
- Protocol for communication.
- Software which runs on Fastboot mode.
- Files which you want to execute with the device.
Both ADB and Fastboot are the part of the Android development software kit. For the installation of these tools at first you need to run your device into Debugging mode. Debugging mode is crucial because it facilitates a connection between the computer and the android device. Consider the steps which are mentioned below for the installation of the Android ADB and Fastboot on Mac.
[box type=”note” align=”aligncenter” class=”” width=””]Read: Download Android USB Drivers for Windows and Mac
Steps to Install Android ADB and fastboot on Mac
Download Android Adb Tools
- First, download ADB installation Scripts for Mac OS X.
- Once you downloaded the Zip file then extract the file to a folder using Archive manager.
Download ADB Scripts For Mac OS
Installing ADB by Opening Terminal
- Open the Launchpad on your Mac OSand launch the Terminal. or you can open the utility folder and launch the terminal from there with the key combinations (Shift+Command+U).
- After opening the Terminal, you should switch to Finder app.
- Now, open the extracted directory and look for the file which is labeled as “ADB-Install-Mac.sh”.
- Now, simply drag and drop ADB-Install-Mac.sh file from the Finder & app to the Terminal window.
- Now the file name will appear in the Terminal window. press the “Enter and Return” key.
- It will ask for your Account Password after pressing the Enter key as shown in below image.
- Now enter your Account Password of your Mac OS and press the Enter Key.
- Done!! It will automatically start executing scripts, install the ADB and USB Fastboot binaries with drivers, “Nice Day” message will be displayed on screen once the installation is successful.
Adb Android Mac Os X
[box type=”note” align=”aligncenter” class=”” width=””]Read: How to Install ADB and Fastboot on Windows
Adb Android Mac Download
You have successfully installed Android ADB and Fastboot on Mac. If you face any issues during the installation process, let us know in the comment section below.