[TOOL] [LINUX/MAC/WINDOWS] Nexus Tools 5 (Featured by XDA) - General Topics

Nexus Tools
Nexus Tools is a simple installer for the Android SDK Platform Tools package, which includes ADB, Fastboot, Systrace, and other applications. Nexus Tools is written in Dart, and can run on Linux, macOS, Windows, Windows Subsystem for Linux, and Chrome OS.
Nexus Tools downloads the latest Platform tools package directly from Google's servers (so you're always getting the latest version), saves them to ~/.nexustools, and adds the directory to your system's path. On Windows, Nexus Tools can optionally install Koush's Universal ADB Driver.
Once Nexus Tools is finished, you can run adb, fastboot, and other commands with no problems. You need to open a new terminal/command line window after installation for changes to take effect. The SDK Platform Tools can be updated by running nexustools -i, or you can uninstall everything by running nexustools -r.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
How to use on Linux, macOS, and Chrome OS
Paste this command into the Terminal app:
Code:
bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/main/install.sh)
You can also download the Mac and Linux versions from the latest release page, un-zip the file, and run it from the Terminal.
Once Nexus Tools is finished, you can run adb, fastboot, and other commands straight from the terminal. You may need to open a new terminal window for changes to take effect. To update, just run the installer again.
How to use on Windows
Open Windows PowerShell from the Start Menu and paste this command:
Code:
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/corbindavenport/nexus-tools/main/install.ps1'))
You can also download the Windows version from the latest release page, un-zip the file, and run it from Windows PowerShell or the Command Prompt.

New in Nexus Tools 3.0:
Cleaned up script code
Fixed udev list being installed on Mac OS X, even though OS X doesn't need it
Less output spam during installation
New logo

corbin052198 said:
New in Nexus Tools 3.0:
Cleaned up script code
Fixed udev list being installed on Mac OS X, even though OS X doesn't need it
Less output spam during installation
New logo
Click to expand...
Click to collapse
Hey, I appreciate your work mate. Nexus Tools has worked well on my Mac. Thanks for creating this tool set. Keep it up!

syintiphic said:
Hey, I appreciate your work mate. Nexus Tools has worked well on my Mac. Thanks for creating this tool set. Keep it up!
Click to expand...
Click to collapse
Glad it worked for you!

New in Nexus Tools 3.1:
Added smart remove (on Ubuntu and Debian linux, Nexus Tools will automatically check if the distro's ADB/Fastboot packages are present and allow you to uninstall them)
Changed udev rules list to automatically overwrite existing list
No longer installs udev list on Mac OS X (because it doesn't use it)

sorry to bother, but will this very useful tool be updated to the latest adb and fastboot versions ? afaik the last adb version is 1.0.35 and the current installed is 1.0.32.
thanks a lot in advance !

I've installed it but the terminal still says -bash: adb: command not found

where can i find 1.0.32? The adb version i have now is 1.0.31...

Any chance you can update the script to install ADB 1.0.36?
UPDATED: I downloaded the latest SDK Tools and moved the adb and fastboot binaries into the .nexustools folder and made the binaries executable using chmod +x on both binaries so now I have adb 1.0.36 and the latest fastboot

1619415 said:
Any chance you can update the script to install ADB 1.0.36?
UPDATED: I downloaded the latest SDK Tools and moved the adb and fastboot binaries into the .nexustools folder and made the binaries executable using chmod +x on both binaries so now I have adb 1.0.36 and the latest fastboot
Click to expand...
Click to collapse
Hey, would you be able to send me the adb and fastboot files? I don't have Android Studio installed on my Mac and so I can't use sdk tools to update my adb to 1.0.36. Thanks.

corbin052198 said:
Nexus Tools is an installer for the Android debug/development command-line tools ADB (Android Device Bridge) and Fastboot for Mac OS X and Linux. The script does not need to be downloaded, simply copy and paste this command into the terminal and run it to install ADB/Fastboot:
Code:
bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.sh)
and this command to un-install Nexus Tools:
Code:
bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/uninstall.sh)
Nexus Tools requires sudo privileges to install/uninstall the adb and fastboot tools to /usr/local/bin, so they can be run without typing the full directory. Nexus Tools is licensed under the GPLv3 license, and the source code is at the GitHub project below.
If you have a problem with Nexus Tools, leave a reply below or as an issue on the GitHub project!
GitHub Project
XDA News Article
Click to expand...
Click to collapse
Thank You so much. You are a life saver. This is amazing. Looked all over for this. It was hard to find.
Thank You.

1619415 said:
Any chance you can update the script to install ADB 1.0.36?
UPDATED: I downloaded the latest SDK Tools and moved the adb and fastboot binaries into the .nexustools folder and made the binaries executable using chmod +x on both binaries so now I have adb 1.0.36 and the latest fastboot
Click to expand...
Click to collapse
Also anyone that's on Linux another way to make adb/fastboot or any binary for that matter executable is to just put a " dot followed by a forward slash in front of your adb or fastboot command " like so...
./adb devices
./fastboot devices

Work like charm on el capitan, thanks for this quick an amazing script

1619415 said:
Any chance you can update the script to install ADB 1.0.36?
UPDATED: I downloaded the latest SDK Tools and moved the adb and fastboot binaries into the .nexustools folder and made the binaries executable using chmod +x on both binaries so now I have adb 1.0.36 and the latest fastboot
Click to expand...
Click to collapse
I ran your script today and ADB is showing 1.0.32 for me. Any way I can get it to 1.0.36?

Google Releases Separate ADB and Fastboot Binary Downloads

could some one tell me where to place the files i want to flash.. i'm not a pro thanks in advance

hjjiang said:
Google Releases Separate ADB and Fastboot Binary Downloads
Click to expand...
Click to collapse
thanks a ton you saved me a lot of time. thanks a lot

I just updated Nexus Tools to version 3.3, which updates the ADB/Fastboot binaries to the latest versions. Enjoy!

i try this but got a message
"Illegal instruction"
i also try
"PATH=~/.nexustools:$PATH"
but there is nothing happen
my computer is mac osx 10.6
how could i fix it
thank you

I can install and working well without any doubt till today.. using the copy of script directed to my terminal.. thanks alot

Related

[Linux/Mac] ADB & Fastboot (Un)Install Script [Team BlueRidge]

[Linux/Mac] ADB & Fastboot Install Script
I have created a script to be used to install ADB and Fastboot on a Mac or a Linux computer. Simply run the script in Terminal or a similar application and it will copy ADB and Fastboot to /usr/local/bin/
Also, as of Version 3.1 this also installs the JDK for Linux-based systems.
While advanced users probably won't need this, it would be good for new users who need help using the ADB and Fastboot commands.
You can see the source at GitHub.
Download
If you have any problems or errors, let me know.
Changelog:
20171202
Moved entirely to GitHub
On Debian-based Linux, installs the adb and fastboot packages
Other systems, the binaries are pulled from Google's website
Executables are given +x permissions
Version 5.0
Hosted on GitHub and Google Code
Uses latest adb and fastboot (as of April 3, 2014)
Install to /usr/local/bin/
Version 4.1
Uses cp rather than mv
Hosted on GitHub again
Team BlueRidge project
Version 4.0
Now installs adb and fastboot to /usr/bin/ which is a more appropriate directory for the files.
Includes Readme now!
Version 3.1
Added JDK Install for Linux
Version 3
Created separate scripts for Linux & Mac
Updated uninstall script
Version 2.1.1
Fixed errors in installer
Version 2.1
More code efficient.
Better comments in script.
Version 2
Combined installer scripts into one Universal
Updated Uninstall.sh to remove udev rules
Version 1.1
Added udev rules for Linux
Version 1
Initial release
Linux
Didn't work on linux, I suggest making a seperate script for linux, I believe the problem is where it detects linux. It gets sudo but nothing more. I ran each command by itself under linux and it worked. Thanks.
shootind5nukes said:
Didn't work on linux, I suggest making a seperate script for linux, I believe the problem is where it detects linux. It gets sudo but nothing more. I ran each command by itself under linux and it worked. Thanks.
Click to expand...
Click to collapse
Thanks! I'll fix that and post an update soon!
JDK is now installed on Linux systems!
Now hosted on Google Code rather than GitHub.
Now installs to /usr/bin/, which is a more appropriate directory as these files are not required for normal system booting or are required for the general functions of your operating system.
i know this thread is old but i need some help.
my devices are not showing up after running the script.
i used adb devices and ./adb devices
boneskid1 said:
i know this thread is old but i need some help.
my devices are not showing up after running the script.
i used adb devices and ./adb devices
Click to expand...
Click to collapse
Does it say that ADB is not found or your devices?
Try enabling ADB (USB Debugging) on your device if it says no devices were found.
Gingerbread: Settings>Applications>Development>USB Debugging
Ice Cream Sandwich: Settings>Developer options>Android debugging
Thanks!!!! This worked perfectly. Using Ubuntu 11.10.
romuloxiii said:
Thanks!!!! This worked perfectly. Using Ubuntu 11.10.
Click to expand...
Click to collapse
I'm happy I could help! Don't forget to click "Thanks" if you liked it!
If you have any issues in the future with it, please feel free to let me know!
Good news!!! This is now a Team BlueRidge project and is on Team BlueRidge's GitHub
since tar.gz files are linux that means I download the zip file on my mac right? sorry if the question is obvious
prflash3 said:
since tar.gz files are linux that means I download the zip file on my mac right? sorry if the question is obvious
Click to expand...
Click to collapse
Download whichever for whichever platform. It's the script inside that you use that matters.
Trying to run the script on OSX, but when I am prompted to enter my password I can't type anything. Please help.
Ditto ul49, being prompted for a password, please advise
Simply type your account password. It won't look like anything is being typed but it is. This is how the "sudo" command works. It is for security.
really glad i found this.
i run "sh "sh script name" and i get this error
ADB-Install-Linux.sh: 5: ADB-Install-Linux.sh: Syntax error: newline unexpected
not sure if it's installed or what
thanks for making this set of scripts and if u could advise me on that error id be grateful.
---------- Post added at 05:46 PM ---------- Previous post was at 05:44 PM ----------
crazy
apt-get install android-tools-fastboot
and
apt-get install android-tools-adb
worked
Just released the first update in two years. Sorry to leave this project unmaintained. The files are now hosted by Team BlueRidge as Google Code no longer supports downloads.
First, thank you very much for putting this together for fellow users. While I'm not the most savy of guys I thought I might just share my experience while installing this ADB + Fastboot package on my MacBook Pro (mid 2012) running OS X Mavericks 10.9.3 in the hopes that somebody might benefit from it as well.
So here it goes:
I tried running the installation script found in "Androidv5.zip" which up until now is the latest version (I think). The script failed to install:
"This will install ADB and Fastboot on your computer.
Root Permissions required. Please type your password.
Password:
Changed directory to /Users/User/Downloads/Androidv5
Moving ADB
cp: /usr/local/bin/adb: No such file or directory
ADB Moved to /usr/local/bin/adb
moving Fastboot
cp: /usr/local/bin/fastboot: No such file or directory
Fastboot moved to /usr/local/bin/fastboot
You may now run Android Debug Bridge and Fastboot commands
Have a nice day."
So I figured I'd open the script file and run each command manually but they would still not work. I then decided to open the target directory
from terminal and it couldn't find it either, so I openned the /usr/ directory to find where the /bin/ directory was... and I found it at | /usr/bin | instead of | /usr/local/bin |.
I ran the commands in the script again manually one by one with the target directory set to | /usr/bin | and then closed terminal and reopened. After that I tried running "adb devices" and the output was "permission denied".
I then applied a "chmod 775 /usr/bin/adb" "chmod 775 /usr/bin/fastboot", closed & reopened terminal and voilà it worked!
Again I'm not a savy guy... there might probably be a better way to do this or perhaps I didn't run the install script as it was supposed to but anyway I decided to let you guys know how it went just in case it proves useful to somebody else....
Then again thanks a lot for sharing this! I finally have ADB + Fastboot on my Mac without having to nag about downloading the Android SDK. :laugh: :good:

[TOOLKIT] Nexus 7 rooting tool for Linux [Updated 09/17/12]

WARNING THIS IS A VERY EARLY VERSION AND MAY CONTAIN A LOT OF BUGS. USE AT YOUR OWN RISK
This is my attempt at making a one-click Nexus 7 rooting tool for Linux; it is written in Python with PyQt4
Features:
-Root/Unroot your device
-Permanently flash CWM recovery (touch or standard version)
-Permanently flash TWRP
-Unlock/Lock the bootloader
-Flash an img file to a selected partition
-Reboot the device into recovery or bootloader mode
-Launch an adb shell
-Backup/Restore your apps and shared data (not paid apps)
-Flash a CWM zip
-More to come
Initial setup:
You must add a udev rule to run this tool as a non-root user
To do that on Ubuntu:
-Hit Alt+F2 and type:
gksu gedit /etc/udev/rules.d/51-android.rules
-Copy/paste the following:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
-Save the file
-And reboot
Alternatively, you can use the included script, setup_udev.sh
You must enable USB debugging on your tablet for this tool to work:
-Go to Settings>Developer options, and check "USB debugging"
Dependencies:
-Python 2.x
-PyQt4
On Ubuntu you can install them like this:
Code:
sudo apt-get install python2.7 python-qt4
* The standalone versions do not have any dependencies
64-Bit users:
You will need to install 32-Bit compatibility libs for adb and fastboot:
Code:
sudo apt-get install ia32-libs
Rooting instructions:
* Right-click n7root.py and choose Properties, go to the Permissions tab and make sure that Allow executing this file as a program is checked (it should be already, but it doesn't hurt to check)
* Now you can start the program by double-clicking n7root.py
* Before Unlocking your device you should click the Backup button to backup your data.
* Before rooting you must unlock the device; do that by clicking the Unlock button
* After unlocking you can restore your data by clicking the Restore button
* Now click the Root button to root the device
* (Optional) If you want to use a custom recovery, select your recovery and click the Install recovery button
Downloads:
Version 4
Standalone executable for Ubuntu 12.04
- Added CWM zip flasher
- Code is now cross-platform and should work on Windows and Mac OS X (untested)
* Mac users will need to download the Mac adb/fastboot binaries and place them in the tools folder renamed to adb.mac and fastboot.mac; they will also need to install Python 2.x and PyQt4
* I made an experimental standalone executable for Windows, but was unable to properly test it because I couldn't get the USB drivers working on Windows 8 x64. It does not currently handle USB driver installation like other toolkits, so you'll have to do that manually.
md5: b53f1d487256b56b25bae74c35f82a91
Ubuntu executable: ebe4249c0855c5a26b7d896e68550d9a
Windows executable: 3d4fe0e419eb7c8fc6d17eef6d66c0b8
Live CD:
This is a bootable Linux live CD based on Knoppix that includes the toolkit and not much else. It can be used on any computer without installing anything; just burn the iso to a CD with Imgburn or write it to a USB drive with Suse Image Writer and boot from it.
Live CD v4
md5: c3a031762437024667e4a7331992238e
Screenshots:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Big thanks to:
* ChainsDD for Superuser
http://androidsu.com
* Koush for CWM
http://www.clockworkmod.com
* Team Win for TWRP
http://teamw.in/project/twrp2
* And Google
stop using toolkits and stop posting toolkits. they are not needed on any nexus device. all you are doing is introducing more problems http://forum.xda-developers.com/showthread.php?t=1815020
simms22 said:
stop using toolkits and stop posting toolkits. they are not needed on any nexus device. all you are doing is introducing more problems http://forum.xda-developers.com/showthread.php?t=1815020
Click to expand...
Click to collapse
This is truth.
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manualy, that's okay.
At least I learned a bit about GUI programming in python while making it.
steevp said:
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manually, that's okay.
At least I learned a bit about GUI programming in python while making it.
Click to expand...
Click to collapse
learning is always good.
No bugs for me on latest version of Ubuntu!
Sucessful root and CWM install, I didn't use it to unlock though
steevp said:
I made this because I saw some requests for a Linux version of Wug's toolkit.
If it's completely useless and Linux users prefer to just do it manualy, that's okay.
At least I learned a bit about GUI programming in python while making it.
Click to expand...
Click to collapse
I like toolkits and I'm a linux user mostly.
Thanks for this.
Sent from my HTC Evo Shift using xda app-developers app
I am using linux cause with windows 8 I can't do anything and this tool is really useful as I am new to the linux ecosystem.
Everything worked smoothly.
Good work and thanks
Please don't stop developing the toolkit. Some people don't like them, but some people do.
ferossan said:
Please don't stop developing the toolkit. Some people don't like them, but some people do.
Click to expand...
Click to collapse
Since people are using it I will continue to improve it.
Currently working on giving more detailed error messages, so that the user isn't left completely clueless if something goes wrong.
Could be possible to improve this tool adding the "Team Win for Open Recovery" (TWRP) as one option as well?
Also, as long I understand, the tool is using "Superuser", is it better than "SuperSU"?
ferossan said:
Could be possible to improve this tool adding the "Team Win for Open Recovery" (TWRP) as one option as well?
Also, as long I understand, the tool is using "Superuser", is it better than "SuperSU"?
Click to expand...
Click to collapse
Yes, I will add an option for TWRP.
I have not used SuperSu yet, I will check it out.
Sent from my Nexus 7 using Tapatalk 2
Ubuntu/nexus 7
Hi!
I'm a Ubuntu user since 8.04...This looks like what I need.
Do you have any more info/success?
Thanks!
MegaKegHead
steevp said:
WARNING THIS IS A VERY EARLY VERSION AND MAY CONTAIN A LOT OF BUGS. USE AT YOUR OWN RISK
This is my attempt at making a one-click Nexus 7 rooting tool for Linux.
The GUI is written in Python with PyQt4 and the actual rooting is done with shell scripts.
Features:
-Root/Unroot your device
-Permanently flash CWM recovery (touch or normal version)
-Unlock/Lock the bootloader
-Flash an img file to a selected partition
-Reboot the device into recovery or bootloader mode
-Launch an adb shell
-More to come
Initial setup:
You must add a udev rule to run this tool as a non-root user
To do that on Ubuntu:
-Hit Alt+F2 and type:
gksu gedit /etc/udev/rules.d/51-android.rules
-Copy/paste the following:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
-Save the file
-And reboot
You must enable USB debugging on your tablet for this tool to work:
-Go to Settings>Developer options, and check "USB debugging"
Dependencies:
-Python 2.x
-PyQt4
On Ubuntu you can install them like this:
Code:
sudo apt-get install python2.7 python-qt4
64-Bit users:
You will need to install 32-Bit compatibility libs for adb and fastboot:
Code:
sudo apt-get install ia32-libs
Downloads:
Version 0.1
md5: ee12e64399173791a922ec82cb2c06eb
Screenshots:
Big thanks to ChainsDD (http://androidsu.com) for Superuser and Koush (http://www.clockworkmod.com) for CWM.
Click to expand...
Click to collapse
I just uploaded version 2
Not a lot has changed feature-wise, but there are many changes under the hood to hopefully make it safer and more reliable.
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
ferossan said:
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
Click to expand...
Click to collapse
Depends most common way is to boot an insecure image then remount system as root then send su and Superuser.apk (and of course) create symboliks link)
I have coded in C++ a tool to root your device in one click. Works in Windows/Mac/Linux and yes it does have a GUI, it is not a command line appliation
Sent from my Nexus 7 using Tapatalk 2
ferossan said:
The included Superuser "zip" should be flashed by booting on Recovery, right? Or the GUI will offer an option?
Thanks!
Click to expand...
Click to collapse
That is done automatically by the GUI
Basically when you click the "root" button it does this:
1. Reboots into bootloader mode
2. Boots a temporary CWM
3. Copies the included Superuser zip to the internal storage
4. And then it flashes the zip
These are the exact commands it runs if you wanted to do it manually:
Code:
$ ./tools/adb reboot bootloader
$ ./tools/fastboot oem unlock
$ ./tools/fastboot boot ./data/recovery-clockwork-6.0.1.0-grouper.img
$ ./tools/adb shell mount /data
$ ./tools/adb push ./data/Superuser-3.1.3-arm-signed.zip /sdcard/
$ ./tools/adb shell recovery --update_package=/sdcard/Superuser-3.1.3-arm-signed.zip
steevp said:
That is done automatically by the GUI
Basically when you click the "root" button it does this:
1. Reboots into bootloader mode
2. Boots a temporary CWM
3. Copies the included Superuser zip to the internal storage
4. And then it flashes the zip
These are the exact commands it runs if you wanted to do it manually:
Code:
$ ./tools/adb reboot bootloader
$ ./tools/fastboot oem unlock
$ ./tools/fastboot boot ./data/recovery-clockwork-6.0.1.0-grouper.img
$ ./tools/adb shell mount /data
$ ./tools/adb push ./data/Superuser-3.1.3-arm-signed.zip /sdcard/
$ ./tools/adb shell recovery --update_package=/sdcard/Superuser-3.1.3-arm-signed.zip
Click to expand...
Click to collapse
Thank you very much. Now everything is comprehensible. :good:
Please do not quit working on this! It worked perfectly for Ubuntu 12.04 and it was very simple and fast.
Doing it manually is a lot of fun, but it's definitely not for everyone.
Thanks again!
Version 3 is now up
This version fixes a bug and adds a backup/restore function for your apps and shared data
PotentChili said:
Please do not quit working on this! It worked perfectly for Ubuntu 12.04 and it was very simple and fast.
Doing it manually is a lot of fun, but it's definitely not for everyone.
Thanks again!
Click to expand...
Click to collapse
Thanks for testing I appreciate it

[GUIDE]All About ANDROID SDK/AVD {Install/AVDs/Root/ADB}

ALL ABOUT ANDROID SOFTWARE DEVELOPMENT KIT\ANDROID VIRTUAL DEVICE(SDK\AVD)​
What we are going to learn?
What is Android SDK?
Installing SDK
Creating and Managing AVDs
Configuring ADB on your Computer
Root your Android Emulator
Thats It!
Part 1 - What is Android SDK?
​
Android Software Development Kit (abbreviation Android SDK) is an application which allows users to run and manage Virtual Android Emulator.
The Android Software Development Kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development platforms include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8 or later, Windows XP or later. The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) Plugin, though IntelliJ IDEA IDE (all editions) fully supports Android development out of the box, and NetBeans IDE also supports Android development via a plugin. Additionally, developers may use any text editor to edit Java and XML files, then use command line tools (Java Development Kit and Apache Ant are required) to create, build and debug Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely).
Enhancements to Android's SDK go hand in hand with the overall Android platform development. The SDK also supports older versions of the Android platform in case developers wish to target their applications at older devices. Development tools are downloadable components, so after one has downloaded the latest version and platform, older platforms and tools can also be downloaded for compatibility testing.
Android applications are packaged in .apk format and stored under /data/app folder on the Android OS (the folder is accessible only to the root user for security reasons). APK package contains .dex files (compiled byte code files called Dalvik executables), resource files, etc.
Source :- Wikipedia
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Part 2 - Installing SDK and AVD Manager​
Make sure you have JAVA Installed.....otherwise NOTHING will work...
WINDOWS
1. Download the SDK setup from here > http://developer.android.com/sdk/index.html
2. Install the SDK and choose a short directory to install (C:\....).
3. After you have installed your SDK, Open It and Check Mark the following package :- Tools
4. Wait for it to Download...It will take some time...Be patient...
Click to expand...
Click to collapse
MAC
Go here to get a guide on HOW TO INSTALL SDK ON MAC
Click to expand...
Click to collapse
Here is a video Guide too
Click to expand...
Click to collapse
LINUX
Go here to get a guide on HOW TO INSTALL SDK ON LINUX
Click to expand...
Click to collapse
Part 3 - Creating and Managing AVDs​
1. Go to your android-sdk directory and start/run "SDK Manager.exe"
2. Select the platform that you want to download.
3. Click on "Install X Packages" where "X" is the no. of packages you have selected to download.
4. After downloading has finished which will take around 30 minutes on a descent speed internet select "Tools" from the Main Menu bar
at the top of the window and select Manage AVDs..........
5. A New window will open which is the AVD MANAGER.
6. In the Android Virtual Devices tab SELECT "New" to create a new AVD.
7. Enter the following things:
AVD NAME: Type the desired name that you want for your AVD
Device: Select the AVD resolution as per the device options
Target: Select the Android version you downloaded
CPU/ABI: Select Intel Atom (x86) for 32-bit and ARM (armeabi-v7) for 64-bit.
Keyboard: Check this box if you want to use your keyboard in the AVD
Skin: Check this box if you want to get the hardware buttons
Front Camera: Use this option if you have a webcam and want to use it in the AVD
Back Camera: Use this option if you have a webcam and want to use it in the AVD
Memory Options
RAM: Set this to 768 (maximum for Windows user) or 1024 (maximum for Ubuntu users
VM Heap: Set this to 100
Internel Storage: Set this to 4 and Select "GiB" from this drop down list from side by.
SD Card: Select "Size" and Enter 4 and Select "GiB" from this drop down list from side by.
Emulation Options
Snapshot: Just check mark this option. (Not really neccessary)
Use Host GPU: Check mark this option if you want to use the computers graphics.
*****NOTE: REMEMBER THESE TWO OPTIONS ("SNAPSHOT" and "USE HOST GPU") CANNOT BE USED SIMULTANEOUSLY. IT WILL GIVE YOU AN ERROR.*****
7. Now click OK and wait for few seconds. It will come up with a dialog box which will show you the details of the AVD you created and a message that your AVD has been created.
8. Running the AVD
Highlight the AVD you have created and click "Start..." on the left of the window.
and ENJOYYYY......
Click to expand...
Click to collapse
Part 4 - Configuring ADB on your Computer​
Configuring ADB (Android Debug Bridge) on your Windows allows you to run adb from anywhere. Hence you always do not have to "cd" to the android-sdk directory.
1. Right click on "My Computer" and select "Properties".
2. Go to "Advanced system settings" and open "Environment Variables".
3. Now under System Variables, click "New"
and enter the following details:-
Variable name: Type in ADB.....
Variable Value: Type here the path of your ADB preceeded by a ";" (SEMI-COLON)
FOR EG: If the path to your ADB is (by default) "C:\Program Files\Android\android-sdk\platform-tools\adb.exe"
THEN YOUR variable path would be :" ;C:\Program Files\Android\android-sdk\platform-tools\adb.exe "
AND CLICK "OK".....
4. After having done with this Search for "Path" in System Variables.
5. Double click on it to edit "Variable Value" and add these lines at the end of it:-
;<PATH_TO_YOUR_ADB> where "<PATH_TO_YOUR_ADB>" is the directory where your ADB is located.
6. Save all these changes by clicking "OK".... and you are done .........
NOW YOU CAN TYPE "adb" ANYWHERE IN CMD AND IT WILL RECOGNIZE IT AS A PROGRAM....
Click to expand...
Click to collapse
Part 5 - Root Your Android Emulator​
Want to get more fun on your Android Emulator.....
GET IT ROOTED....
NOTE: YOU MUST HAVE ADB CONFIGURED....... I HAVE TESTED THIS ROOTING METHOD ON API LEVEL 16 ( JELLY BEAN 4.1.2) AND IT WORKS ABSOLUTELY FINE NOT SURE ABOUT OTHERS.....
1. Download the ROOT package from here.
2. Extract the package to somewhere like desktop.
3. Browse to your android-sdk/tools directory and Hold Shift and then right click to get an Advanced Menu. Click on "Open Command Window Here" and type the following command:-
Code:
emulator -avd <YOUR_AVD_NAME> -partition-size 512
NOTE:- DO NOT CLOSE THE COMMAND PROMPT WINDOW OTHERWISE THE EMULATOR WILL CLOSE
4. Now go to Desktop and again hold Shift and right click and Select "Open Command Window Here" and type the following commands one by one:-
Code:
adb connect 127.0.0.1:5554
adb root
adb remount
adb push Superuser.apk /system/app/
adb push su /system/bin/su
adb push su /system/sbin/su
adb push su /system/xbin/su
adb shell chmod 6755 /system/bin/su
adb shell chmod 6755 /system/sbin/su
adb shell chmod 6755 /system/xbin/su
adb kill-server
adb start-server
YOHO............... We are now rooted haha
Click to expand...
Click to collapse
Want to know anything more....Just post it here.....and I'll help you back.... ​
Have I missed something....Please remind me....
Hi
Thanks for this, exactly what i was looking for.
But I find that after I have expanded the /system partition when i restart the AVD it starts with a 211M sized partition. unless i start it from the command line.
Is there any way to change the ini file or the avd manager to start it with 512M /system ?
Also the SU didn't work, I had to grab one of my working phone.. (there was a hex error code)
/system/bin/sh: /system/xbin/su: not executable: magic 7F45
actually spoke way to early no I find the /system partition doesn't save a cross reboots
last edit.
found http://www.ehalm.at/avd-4.3-gapps.php?l=en
has a pre built 4.3 system img with all the goodies installed
Hello and thanks for your OP.
Do you have the binaries for Intel? Intel emulators being way faster, I'd rather root an intel AVD than use ARM.
Also, is there a way to make SU survive reboots? It's very annoying to have to repeat those steps each time.
error: device not found
Thanks for this guide. Had me thinking of how to connect a AVD to adb since there is no USB to physically plug in.
I did try the loopback address, with the right port, but that is as far as I have got:
Code:
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb connect 127.0.0.1:5554
[sudo] password for joel:
connected to 127.0.0.1:5554
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb root
error: device not found
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb devices
List of devices attached
[email protected]:~/Build/android-sdk-linux/tools$
Is there anything I am doing wrong? I know your guide (mostly) is for windows, but it would seem strange for me to emulate Android in an emulated Windows environment (running Debian GNU/Linux v7).
UPDATE: Figured it out, once I used the ./adb command in platform-tools.

[WIP][GUIDE] Adb beginner to Pro[In-Depth]

A thanks here would be highly appreciated :good::good::good:
Any developing you take with Android you need ADB its the acronym fo Android Debugging Bridge
Today I am going to show you how to use Adb , how to build it , how to play with its source
Beginner ​Lets introduce to you adb
Think adb as your messenger ,
You type a message / command
Then that message is taken by adb and delivered to the phone
the phone client would execute or perform any necessary tasks
Installing Adb
HOW TO INSTALL ADB [Linux]
On Ubunutu
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
{I Need more distro's command if you know please contact me}
HOW TO INSTALL ADB ON WINDOWS
http://forum.xda-developers.com/showthread.php?p=48915118
Lets Now play with basic adb commands
================================================================================================
adb devices : This allows you to confirm that your pc and device are communicating
syntax
Code:
adb devices
adb pull : This allows you to pull specific files from the device
syntax
Code:
adb pull /sdcard/you_know_what.jpg
adb push : This allows you to send specific files to the device
syntax
Code:
adb push file.txt /sdcard/0/
================================================================================================
adb reboot : You can guess the command's function by looking at it and you were probably right it just "reboot" your phone
syntax
Code:
adb reboot
adb reboot-bootloader : This is same as its parent (adb reboot) but instead of rebooting to Android OS it boots to the bootloader
adb reboot-recovery : This is same as its parent (adb reboot) but instead of rebooting to Android OS it boots to the recovery
================================================================================================
adb shell : This executes a command on the device
Info : You can just pass a single command to the device to execute or you can also open an interactive shell
syntax ( single command ) :
Code:
adb shell [I]command[/I]
synatx ( interactive shell ) :
Code:
adb shell [ENTER]
command"s"
adb sideload : ADB sideload is a different ADB mode that you can use to push and install a zip using one command from your computer
Info : This was introduced in Jelly Bean Aosp
syntax :
Code:
adb sideload /sdcard/0/rom.zip
================================================================================================
adb install : This allows you to install any apps on the device using adb
syntax :
Code:
adb install TheApp.apk
info : running adb install with -r flag makes it install the app on the sdcard of the device (if the rom supports it)
adb uninstall : This allows you to uninstall an app on the device
syntax :
Code:
adb uninstall com.company.appname
info : using -k option uninstalls the application while retaining the data/cache.
At the moment, there is no way to remove the remaining data.
You will have to reinstall the application with the same signature, and fully uninstall it.
adb logcat : This allows you to access the logs / events of the system/apps
syntax :
Code:
adb logcat
{I would do a more in-depth synopsis of these command in my next post}
================================================================================================
Great post! This will be an excellent tool for anyone wanting to learn adb.
================================================================================================
After you have played with adb now lets gets the level
Amateur​Now after playing with commands your curiosity has risen and you want to know How does adb work ?
let me break the confusion
Adb has 3 major components
Adb client
adb server
adb daemon (adbd)
Lets see what each of them does
================================================================================================
adb server : You can consider this as a daemon running on the PC . It manages the communication between the adb client and adbd daemon. Its purpose if to sense the USB ports to know when devices are attached/removed, as well as when emulator instances start/stop.It thus maintains a list of "connected devices" and assigns a 'state' to each one of them: OFFLINE, BOOTLOADER, RECOVERY or ONLINE
================================================================================================
adb client: This is the clients that communicates with the server to give commands. It first tries to locate the ADB server on the host machine, and will start one automatically if none is found.
================================================================================================
Info: At this moment a single 'adb' binary is used for both the server and client
================================================================================================
adbd : The daemon runs on the device side and listens for for the commands on the usb or tcp. The adb server tries to communicate with the adbd daemon, if the connection is made then it labels the device as online else if , the connection to the device is made but the server cant communicate with the adbd then the device is labelled as offline.
In Android adbd is started when the data partition is mounted it is started by init.usb.{ro.hardware}.rc you can mod it to run earlier on your rom builds
================================================================================================
================================================================================================
Now lets move on to the next level
PROFESSIONAL​Before Moving in here please see familiarize your self with Android Building
After you have followed the guide , Now lets start building the adb
Prepare the environment
Code:
source ./build/envsetup.sh
lunch lineage_devicecodename-eng
mka adb fastboot
Now you can check $OUT directory for the executable
Code:
which adb
which fastboot
================================================================================================
Lets first see how the communication between the client and the adb server works
The adb server listens on tcp::localhost:5037
A diagram representing the structure
A Graphic by forum.xda-developers.com wiki
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
so the client connects to tcp:localhost:5037 and sends a request in the following way
A 4-byte hexadecimal string giving the length of the command
And then followed by the command itself
so a million dollar question how does the adb server responds to the client ?
Server would respond in 2 ways :
For success, the 4-byte "OKAY" string
For failure, the 4-byte "FAIL" string, followed by a 4-byte hex length, followed by a string giving the reason for failure.
Note : In a special case of adb's version the a 4-byte hex string corresponding to the server's internal version number would be returned
Note : For different commands the behavior is different so I would make a separate post About it
================================================================================================
Now for building the adb as you have already see you use mka adb fastboot
The main thing over here is Android.mk of the adb and the folder structure
Lets start by counting the number of modules built by the Android.mk
LOCAL_MODULE := libadbd
LOCAL_MODULE := libadb
LOCAL_MODULE := adbd_test
LOCAL_MODULE := libdiagnose_usb
LOCAL_MODULE := adb_test
LOCAL_MODULE := adb
LOCAL_MODULE := adbd
So these were the 7 module built by it
================================================================================================
Now I would leave you on your own to figure the source code ( i made it quite easy , didnt i ? )
I would continue writing in my next post how do the commands execution work
So this was the end of the professional I hope you learnt something If you need more stuff here please contact me
[WIP][If anyone can do the diagrams it would be a huge help i would give you the whole credit for images]

Making a simple ADB shell script.

So i am trying to make a simple shell script which will execute multiple ADB commands, here's what i have come up with.
#bin/sh
echo -------------------------------
echo Removing lockscreen ads...
echo -------------------------------
adb shell pm disable-user --user 0 com.amazon.kindle.kso
when i try to do, bash file.sh it just says bash is a unknown command, so what am i doing wrong?
ADB is a commandline tool to be run either on Windows OS, preferredly wrapped into a Windows CMD script, or in Android OS, preferredly wrapped into an Android shell script.
If you intend to run ADB commands in Android's terminal then a shell script would look like this
Code:
#!sbin/sh
ADB=/usr/bin/adb
"$ADB" shell "<COMMAND-HERE>"
jwoegerbauer said:
ADB is a commandline tool to be run either on Windows OS, preferredly wrapped into a Windows CMD script, or in Android OS, preferredly wrapped into an Android shell script.
If you intend to run ADB commands in Android's terminal then a shell script would look like this
Code:
#!sbin/sh
ADB=/usr/bin/adb
"$ADB" shell "<COMMAND-HERE>"
Click to expand...
Click to collapse
Okay, thank you. will try that right away
i could also use this in a windows batch file?(sorry bit of a noob about this )
ComputerTech312 said:
i could also use this in a windows batch file?(sorry bit of a noob about this )
Click to expand...
Click to collapse
If you'ld carefully read posts then you'll notice this question already get answered.
jwoegerbauer said:
If you'ld carefully read posts then you'll notice this question already get answered.
Click to expand...
Click to collapse
Apologies, i misread your post
What would the changes be to your code if it's a Windows CMD script? would changes to the path be required and such?
It really depends on what you're trying to do.
I wrote the following as a simple .bat file and ran it from my platform-tools directory on my Windows laptop:
@Echo Off
echo Checking for Devices.
adb devices
echo Is device present?
echo (Press Enter if yes, Ctrl+C or close Script if not)
pause
echo Rebooting to recovery.
adb reboot recovery
echo Waiting 30 seconds for reboot.
timeout /t 30
echo Checking for Devices.
adb devices
echo Is device present?
echo (Press Enter if yes, Ctrl+C or close Script if not)
pause
echo Decrypting Data in TWRP.
adb shell twrp decrypt ******
pause
Click to expand...
Click to collapse
And it does the following:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ComputerTech312 said:
What would the changes be to your code if it's a Windows CMD script? would changes to the path be required and such?
Click to expand...
Click to collapse
An Android shell script and a Windows bash script ( including a Powerpoint script ) are in all aspects different with regards to coding, this because Android shell scripts are coded using Linux synthax.
BTW:
To not have to dance on 2 weddings I create my scripts mainly as pure Android shell scripts, which I copy from PC to Android device, and then start executing it from PC by means of ADB using a Windows bash script.
Example Windows bash script:
Code:
@echo off
adb devices
adb push <ANDROID-SCRIPT-PATH-ON-PC-HERE> /tmp
adb shell "chmod 0755 /tmp/<ANDROID-SCRIPT-NAME-HERE>"
adb shell "cd /tmp; $(<ANDROID-SCRIPT-NAME-HERE>);"
adb shell "rm -f /tmp/<ANDROID-SCRIPT-NAME-HERE>"
Deleted member 1890170 said:
An Android shell script and a Windows bash script ( including a Powerpoint script ) are in all aspects different with regards to coding, this because Android shell scripts are coded using Linux synthax.
BTW:
To not have to dance on 2 weddings I create my scripts mainly as pure Android shell scripts, which I copy from PC to Android device, and then start executing it from PC by means of ADB using a Windows bash script.
Example Windows bash script:
Code:
@echo off
adb devices
adb push <ANDROID-SCRIPT-PATH-ON-PC-HERE> /tmp
adb shell "chmod 0755 /tmp/<ANDROID-SCRIPT-NAME-HERE>"
adb shell "cd /tmp; $(<ANDROID-SCRIPT-NAME-HERE>);"
adb shell "rm -f /tmp/<ANDROID-SCRIPT-NAME-HERE>"
Click to expand...
Click to collapse
I am doing similar adb commands but from a bash script on a PC connected only via wifi to android box.
FYI, unlike a phone these Android 11 devices are not recognized by Windows11 when connected via a USB cable.
Commands I issue are things like
$ADB_CMD shell pm uninstall org.courville.nova
Before I can use these varous ADB commands I have to
(1) manually add the box to my wifi (via a mini-keyboard attached to android box)
(2) figure out which IP it was assigned by my router
(3) update my script with the correct IP to it can issue all the $ADB_CMD = eg. "../ADB -s 192.168.123:5555"
(4) run the script
I would like to skip steps 1..3, so the idea of running a similar script on the android box is very attractive.
(1) prepare a usb thumbdrive with a script, aps, ... and plug it into the android device
(2) use the filemanager on the device to execute the script
(3) done (ie. never have to connect to wifi).
What do you suggest doing?
I assumed by the nature of it's name "bridge" that ADB is meant to be run over a connection?
Ideally I would like to install nothing on the android device but I would not mind if a script installed some apk from the thumbdrive and then de-installed it.
The device is rooted.
Can you actually get some shell prompt on Android? or does it require an app to be installed.
I saw references to /usr/bin/sh I have no idea how to start one
Thank you for helping out.
Short answer: use
SH Script Runner for Android - APK Download
Download SH Script Runner apk 1.10 for Android. Bash script runner and shell command executor with superuser functionality.
apkpure.com
app to run scripts on Android device without the need of ADB
.
xXx yYy said:
.
xXx yYy said:
Short answer: use
SH Script Runner for Android - APK Download
Download SH Script Runner apk 1.10 for Android. Bash script runner and shell command executor with superuser functionality.
apkpure.com
app to run scripts on Android device without the need of ADB
Click to expand...
Click to collapse
Click to expand...
Click to collapse
So I downloaded SH Script Runner_v1.10_apkpure.com.apk onto a thumbdrive
I insert it into the android device I have to install it manually?
can you provide a sample script.sh that would run the equivalent of I can take it from there
$ADB_CMD shell pm uninstall org.courville.nova
...
I went ahead and installed the SH Script Runner it looks like it's designed to create/manage several scripts. I am not sure I understand yet it's flow.
When accessing the upper-right menu ... "open local script" It does not appear to let me browse other than internal /sdcard IOW, it does not seem to list my connected thumbdrive like this simple FileManager or X-plore would.
Once I understand the syntax of this script.sh I will convert my current make.sh and take it over the android device.
I do all my script editing on a PC with VScode editor.
Thank you for your guidance.
SH Script Runner is both a script editor and script executor, means write your code into this editor and run the script.
Example:
Code:
pm uninstall org.courville.nova

Categories

Resources