Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,637 Members 39,964 Now Online
XDA Developers Android and Mobile Development Forum

[SCRIPT] ADB, Fastboot and mFastboot directly in Terminal - MacOSX

Tip us?
 
MoisesPerez
Old
#1  
MoisesPerez's Avatar
Member - OP
Thanks Meter 8
Posts: 33
Join Date: Oct 2013
Location: Mexico
Default [SCRIPT] ADB, Fastboot and mFastboot directly in Terminal - MacOSX

Hello all

So here I am in my first topic

For Mac users can be tough to work with commands, which most of it has to be done in order to perform stuff in our Moto X.

Instead of having to mount virtual machines in order to have access to Windows' stuff. Or the Android SDK has to be installed, browse to specific folders to run commands from them, etc.

We can work directly in our precious Terminal!

So, I made a little script that will allow Mac users to work directly on Terminal, no matter which folder we are working on. I've included the following files:
  • adb
  • fastboot
  • mfastboot (Motorola's modified version of fastboot)

To Install
  1. Run Terminal (/Applications/Utilities/Terminal.app)
  2. Browse to the folder in which the script resides, i.e., if it’s in Desktop, then type in Terminal “cd Desktop/ADBInstall” (without quotes).
  3. To run the script type “./install.sh” (without quotes).
  4. You will see input on the screen.
That’s it

To Uninstall

You can safely remove the 3 files in one command, just run the uninstall.sh script by following step 1 and 2 from the Install section. Instead of following step 3, type the following in Terminal: “./unistall.sh” (without quotes).

Hope you like it
Attached Files
File Type: zip ADBinstall.zip - [Click for QR Code] (1.09 MB, 74 views)
Current device: Moto X XT1053 (BL unlocked, running KangaKat 4.4.2)
Previous: Galaxy S3 Mini I8190L(custom recovery, custom ROM, custom EVERYTHING)
Before Android: iPhone 4S (iOS 6.1.3 Jailbroken), Blackberry 9360 (unlocked, running European OS), Sony Ericsson W810i (unlocked. best non-smartphone EVER)
The Following 2 Users Say Thank You to MoisesPerez For This Useful Post: [ Click to Expand ]
 
HeroOfTime
Old
#2  
HeroOfTime's Avatar
Senior Member
Thanks Meter 25
Posts: 136
Join Date: Jun 2010
Location: Mountain Green
Hey, thanks for creating this script. However, I am running into a problem. I run ./install.sh, it runs through the install text, but when I try to run an adb command to test it out, I get the following error: -bash: ./adb: No such file or directory. I went into /usr/bin/ and adb, fastboot and mfastboot all show up there and can run when I'm in the directory, but if I'm outside of the directory, it won't run. Any suggestions? Cheers.
--This message will self destruct if not properly stored.

Moto X - Navy Blue with Silver Accents, Bootloader Unlocked, Rooted, Xposed (How do you like them apples, VZW?)
 
MoisesPerez
Old
#3  
MoisesPerez's Avatar
Member - OP
Thanks Meter 8
Posts: 33
Join Date: Oct 2013
Location: Mexico
Quote:
Originally Posted by HeroOfTime View Post
Hey, thanks for creating this script. However, I am running into a problem. I run ./install.sh, it runs through the install text, but when I try to run an adb command to test it out, I get the following error: -bash: ./adb: No such file or directory. I went into /usr/bin/ and adb, fastboot and mfastboot all show up there and can run when I'm in the directory, but if I'm outside of the directory, it won't run. Any suggestions? Cheers.
It's weird, though.

Did it ask for your password? You can force root access by typing: "sudo ./install.sh" instead.

Can you show me your input screen on Terminal after running the installer?
Current device: Moto X XT1053 (BL unlocked, running KangaKat 4.4.2)
Previous: Galaxy S3 Mini I8190L(custom recovery, custom ROM, custom EVERYTHING)
Before Android: iPhone 4S (iOS 6.1.3 Jailbroken), Blackberry 9360 (unlocked, running European OS), Sony Ericsson W810i (unlocked. best non-smartphone EVER)
 
HeroOfTime
Old
#4  
HeroOfTime's Avatar
Senior Member
Thanks Meter 25
Posts: 136
Join Date: Jun 2010
Location: Mountain Green
Quote:
Originally Posted by MoisesPerez View Post
It's weird, though.

Did it ask for your password? You can force root access by typing: "sudo ./install.sh" instead.

Can you show me your input screen on Terminal after running the installer?
Thanks for looking into this for me. Yes, it did ask for my password. Here is what I get after running the installer:

Jareds-MBP:ADBinstall Jared$ ./install.sh
This will install ADB, Fastboot and mFastboot on your computer.
Root Permissions required. Please type your password.
Password:
Changed directory to /Users/Jared/Desktop/ADBinstall
Copying ADB...
ADB copied to /usr/bin/adb
Copying Fastboot...
Fastboot copied to /usr/bin/fastboot
Copying mFastboot...
mFastboot copied to /usr/bin/mfastboot
You may now run Android Debug Bridge, Fastboot and mFastboot commands
Have a nice day

I'm attaching a screenshot of the output as well, but that is the output I get, which seems correct.
Attached Thumbnails
Click image for larger version

Name:	ADBinstall.png
Views:	20
Size:	45.5 KB
ID:	2878759  
--This message will self destruct if not properly stored.

Moto X - Navy Blue with Silver Accents, Bootloader Unlocked, Rooted, Xposed (How do you like them apples, VZW?)
 
MoisesPerez
Old
#5  
MoisesPerez's Avatar
Member - OP
Thanks Meter 8
Posts: 33
Join Date: Oct 2013
Location: Mexico
Np! Yes, it seems correct.

So, if you run, let's say, "adb devices" you get the bash error?
Did you try to close session and open a new one?

Regards
Current device: Moto X XT1053 (BL unlocked, running KangaKat 4.4.2)
Previous: Galaxy S3 Mini I8190L(custom recovery, custom ROM, custom EVERYTHING)
Before Android: iPhone 4S (iOS 6.1.3 Jailbroken), Blackberry 9360 (unlocked, running European OS), Sony Ericsson W810i (unlocked. best non-smartphone EVER)
 
HeroOfTime
Old
#6  
HeroOfTime's Avatar
Senior Member
Thanks Meter 25
Posts: 136
Join Date: Jun 2010
Location: Mountain Green
Quote:
Originally Posted by MoisesPerez View Post
Np! Yes, it seems correct.

So, if you run, let's say, "adb devices" you get the bash error?
Did you try to close session and open a new one?

Regards
Exactly. adb devices has been my test command. Yeah, I tried closing out the session, I logged off using the 'exit' command and quit Terminal.

Just odd that it installs fine and shows up in /usr/bin, but I can't get it to work. I am running the beta of OS X Yosemite, but I doubt that would impact anything, since it installs.

Hmmm... Weird stuff.
--This message will self destruct if not properly stored.

Moto X - Navy Blue with Silver Accents, Bootloader Unlocked, Rooted, Xposed (How do you like them apples, VZW?)
 
MoisesPerez
Old
#7  
MoisesPerez's Avatar
Member - OP
Thanks Meter 8
Posts: 33
Join Date: Oct 2013
Location: Mexico
Quote:
Originally Posted by HeroOfTime View Post
Exactly. adb devices has been my test command. Yeah, I tried closing out the session, I logged off using the 'exit' command and quit Terminal.

Just odd that it installs fine and shows up in /usr/bin, but I can't get it to work. I am running the beta of OS X Yosemite, but I doubt that would impact anything, since it installs.

Hmmm... Weird stuff.
Really weird! I'm using Mavericks, but I also doubt this may cause the script not to work.

Here's my Terminal window running from my user's main folder.

I don't know what else to try man. The only option is to take them out of usr/bin and just create a "work" folder to use them. That's how I started

Best
Attached Thumbnails
Click image for larger version

Name:	adb.png
Views:	27
Size:	46.2 KB
ID:	2878858  
Current device: Moto X XT1053 (BL unlocked, running KangaKat 4.4.2)
Previous: Galaxy S3 Mini I8190L(custom recovery, custom ROM, custom EVERYTHING)
Before Android: iPhone 4S (iOS 6.1.3 Jailbroken), Blackberry 9360 (unlocked, running European OS), Sony Ericsson W810i (unlocked. best non-smartphone EVER)
 
HeroOfTime
Old
#8  
HeroOfTime's Avatar
Senior Member
Thanks Meter 25
Posts: 136
Join Date: Jun 2010
Location: Mountain Green
Quote:
Originally Posted by MoisesPerez View Post
Really weird! I'm using Mavericks, but I also doubt this may cause the script not to work.

Here's my Terminal window running from my user's main folder.

I don't know what else to try man. The only option is to take them out of usr/bin and just create a "work" folder to use them. That's how I started

Best
Well thanks a lot for your help. Still a great resource. I will keep playing around with things and maybe get it to work.

Thanks again!
--This message will self destruct if not properly stored.

Moto X - Navy Blue with Silver Accents, Bootloader Unlocked, Rooted, Xposed (How do you like them apples, VZW?)
 
MoisesPerez
Old
#9  
MoisesPerez's Avatar
Member - OP
Thanks Meter 8
Posts: 33
Join Date: Oct 2013
Location: Mexico
Not a problem my friend. Good luck!
Current device: Moto X XT1053 (BL unlocked, running KangaKat 4.4.2)
Previous: Galaxy S3 Mini I8190L(custom recovery, custom ROM, custom EVERYTHING)
Before Android: iPhone 4S (iOS 6.1.3 Jailbroken), Blackberry 9360 (unlocked, running European OS), Sony Ericsson W810i (unlocked. best non-smartphone EVER)

The Following User Says Thank You to MoisesPerez For This Useful Post: [ Click to Expand ]
Tags
adb, fastboot, mac, moto x, terminal
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more

Android App Review: Hide Your Files with Androignito – XDA Developer TV

Stop right now, look at your phone, and see how many pictures, … more

BrightNotes Makes Cloud Notes Simple and Easy

There are literally thousands of note taking apps available on Android, with practically every … more