Learn More About Linux with Linux Man Pages

Linux is quite a powerful and very configurable operating system. Thanks to some user-friendly … more

Detect, Avoid IMSI-Catcher Attacks with Android IMSI-Catcher Detector

Privacy is always an important topic, as well as a delicate one to … more

Materialized LeanDroid Fights Your Poor Battery Life

Battery life has always been one of the biggest problems facing most Android devices. … more

Bump! Workaround for the LG G3 Locked Bootloader – XDA TV

The LG G3 is a power house device. It’s been a favorite of many people. … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP MoisesPerez

16th July 2014, 04:06 AM   |  #1  
MoisesPerez's Avatar
OP Member
Flag Mexico
Thanks Meter: 12
 
51 posts
Join Date:Joined: Oct 2013
More
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, 442 views)
The Following 3 Users Say Thank You to MoisesPerez For This Useful Post: [ View ]
31st July 2014, 10:10 PM   |  #2  
HeroOfTime's Avatar
Senior Member
Flag Mountain Green
Thanks Meter: 30
 
150 posts
Join Date:Joined: Jun 2010
More
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.
1st August 2014, 03:44 AM   |  #3  
MoisesPerez's Avatar
OP Member
Flag Mexico
Thanks Meter: 12
 
51 posts
Join Date:Joined: Oct 2013
More
Quote:
Originally Posted by HeroOfTime

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?
1st August 2014, 04:39 AM   |  #4  
HeroOfTime's Avatar
Senior Member
Flag Mountain Green
Thanks Meter: 30
 
150 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by MoisesPerez

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:	69
Size:	45.5 KB
ID:	2878759  
1st August 2014, 04:45 AM   |  #5  
MoisesPerez's Avatar
OP Member
Flag Mexico
Thanks Meter: 12
 
51 posts
Join Date:Joined: Oct 2013
More
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
1st August 2014, 05:22 AM   |  #6  
HeroOfTime's Avatar
Senior Member
Flag Mountain Green
Thanks Meter: 30
 
150 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by MoisesPerez

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.
1st August 2014, 06:10 AM   |  #7  
MoisesPerez's Avatar
OP Member
Flag Mexico
Thanks Meter: 12
 
51 posts
Join Date:Joined: Oct 2013
More
Quote:
Originally Posted by HeroOfTime

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:	74
Size:	46.2 KB
ID:	2878858  
1st August 2014, 03:33 PM   |  #8  
HeroOfTime's Avatar
Senior Member
Flag Mountain Green
Thanks Meter: 30
 
150 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by MoisesPerez

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!
1st August 2014, 04:11 PM   |  #9  
MoisesPerez's Avatar
OP Member
Flag Mexico
Thanks Meter: 12
 
51 posts
Join Date:Joined: Oct 2013
More
Not a problem my friend. Good luck!

The Following User Says Thank You to MoisesPerez For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
adb, fastboot, mac, moto x, terminal
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes