Xperia on Ubuntu (Udev rules, Flashtool, ADB&Fastboot) - Xperia Play Q&A, Help & Troubleshooting

This is a thread written to try and get poor MilkyJoePD up and running with his Ubuntu build, but it should be of help to anyone.
First of all, what you need:
1) Any version of Ubuntu from 10.04 onwards, with superuser access. The upcoming LTS Ubuntu 12.04 will be a great idea when it comes out, as it'll be maintained for 5 years (so the instructions to install it there will be valid for all that time).
2) Your Xperia Play (or any Xperia phone actually).
3) A Micro USB cable to connect it.
4) An open mind about terminal emulators. They're useful because they allow you to do things quickly and cleanly, if you just know their syntax.
What will we be doing in this thread: we'll set up our Xperia Play so that it gets recognized properly by Ubuntu. In addition, we'll set up ADB and Flashtool, which are programs with which our Xperia Play can interact. Lastly, we'll cover how to summon the "adb" and "fastboot" commands from any point in the terminal, by adding them to the $PATH variable.
Setting up the Xperia phone: udev rules
Android devices don't need specific drivers to work in Linux: you can plug an Android phone and it will be recognised as a flash drive. However, if we want deeper levels of interaction, such as the ones which ADB, Fastboot and Flashtool provide, we have to set up udev rules. Long story short, udev rules allow us to give the proper permissions that these modes require without having to function as superuser the whole time (an undesirable state of things in Ubuntu). Much more about them can be found here for the curious minds out there.
But let's not get lost. We want to set up udev rules, so we'll do it. First of all, we need to know the following: a device connected while it functions normally is not "seen" as the same device when it's connected in the Flash or Fastboot modes. In order to identify it, we can run "lsusb" which lists all of the ports, and connected devices, in our computer.
So, let's connect a Xperia phone which is turned on. We don't have to mount the sdcard as a flash drive, just plug it in. Once you have done that, open a terminal and type
Code:
lsusb
It will list you a boatload of devices, but only one of them is relevant to you right now:
Code:
Bus 00x Device 00y: ID 0fce:aaaa Sony Ericsson blah blah
The device is identified with two alphanumeric chains. The first one is the vendor ID, and the second one is the Product ID, which are the identificators we're going to use for the udev rules later on.
Let's switch off our phone, and plug it in "Flash" mode (hold the Back button while you connect it). Run "lsusb" again in the terminal again, and you'll find:
Code:
Bus 00x Device 00y: ID 0fce:bbbb Sony Ericsson blah blah
The Vendor ID is the same (0fce) for all Sony Ericsson devices, but the Product ID is different, as you can see. This is consistent with the idea that it's identified as "another" device.
The last part would be plugging the phone in Fastboot mode, holding the Search key while we plug the phone. Typing "lsusb" in the terminal again will give us:
Code:
Bus 00x Device 00y: ID 0fce:cccc Sony Ericsson blah blah
Which is, as we know already, a different Product ID.
Now that we have the device ID needed for the udev rules, we can write them. The most expedite way is to write in that lovely terminal:
Code:
sudo gedit /etc/udev/rules.d/99-android.rules
That means, we'll use the standard text editor (gedit) to create the file 99-android.rules in the /etc/udev/rules.d folder. If we visit said folder we'll find other udev rules created already, but they're not interesting for our task. Notice that we ask for superuser permissions with "sudo" as we need them to write or modify udev rules. Once we have put our password we'll find an empty text file. And now we just copy-paste the following syntax:
Code:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”aaaa″, MODE=”0666″
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”bbbb″, MODE=”0666″
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”cccc″, MODE=”0666″
In human language, this means "Give the devices that are connected through USB and which have the mentioned ID codes the permissions 0666 (read/write access), which need root access".
Once we've filled the gaps, we just save the file. After we close it, we have to type in the terminal "sudo restart udev" and we've taken care of that part. Rebooting the computer has the same effect, but it's a bit of overkill, really.
Flashtool
With the udev rules fixed, we can go to the next step, which would be using Flashtool. It is necessary to mention that unlike the Windows version, Flashtool doesn't need any installation of any kind in Linux, you just run the program (the file called Flashtool) and you're set. You have to download the Flashtool folder, uncompress it and run the program. The folder is compressed in .7z format: Ubuntu doesn't manage 7z packages "out of the box", but that's no problem: go to your terminal, type:
Code:
sudo apt-get install p7zip-full
and that should take care of it. If you're not familiar with that command, "apt-get install" is the way to install packages from your existing repositories in Debian/Ubuntu; installing software in Ubuntu requires superuser access, as I'm sure you know. p7zip-full is a package which adds 7zip support to the archive manager of Ubuntu.
I won't cover how to use Flashtool, since I already did so in this post. While I made the tutorial for an older version of Flashtool, the base functions are exactly the same as before.
Optional: ADB and Fastboot; setting them in $PATH
OK, now we're going to the stronger stuff: if you want to do a bit more than restoring official ROMs and flashing kernels you'll do well in using the ADB and Fastboot programs. They're part of the platform tools of the Android SDK. You can download the latest Android SDK here: http://developer.android.com/sdk/index.html
Once you've downloaded and uncompressed the Linux version of the SDK, go to the "tools" folder and run the "android" file (you need to mark it as executable first, in the properties). That file is the Android SDK Manager. Once it's running, you only need to install the SDK Platform Tools package. The rest are not necessary for our purposes.
Once you install the package, you'll notice that the folder where you unpacked the SDK is bigger. You'll find there the "platform-tools" folder, which contains adb and fastboot. You can run them from a terminal, but that requires you to have your terminal running in the exact folder where your /<Path/to/SDK> directory lies. This can get old really quickly if you use ADB and/or Fastboot frequently, so we'll do a trick that will allow us to summon them from any folder: we'll add them to our PATH variable.
In order to do this, we need to open a new terminal. It will start in our home directory. There is a file called .bashrc in our home folder that we need to tweak, so let's go to it. You don't see it normally, as it's hidden. All files which begin with a . in Linux will be hidden by default. You can see them in Nautilus by pressing Ctrl+H, and in a terminal by typing "ls -a". At any rate, this file is hidden because you usually don't need to touch it, but we'll do it here.
In our terminal, we write
Code:
gedit .bashrc
Again, gedit is the standard text editor in Ubuntu.
We see a lot of stuff we don't need to touch. We just need to go to the final line, after the word "fi" and write below:
Code:
# ADB and Fastboot direct link (this is a comment, so we remember what we did)
PATH=$PATH:/home/Path/to/SDK/platform-tools/
export PATH
We save the modified file, close any terminal we had left open, and now we can use adb and fastboot directly from any folder. Just connect your device with debug mode on for example, and type "adb devices": you should see the ADB identificator of your device.
And with that, I cover the installation guide of Xperia phones in the Ubuntu environment. I hope it's useful to everyone, particularly to MilkyJoePD who has inspired me to write it. If I've missed something I should have mentioned, by all means say it.

Haven't used Ubuntu for a while but I'm taking note of this for later. Thank you for the info.
Sent from a Galaxy far, far away

don't forget to install de dependencies:
Code:
sudo apt-get install libusb-1.0
on 64 systems, you need 32bits libraries, so run:
Code:
sudo apt-get install ia32-libs

With the news of Sony not releasing ICS, I decided to try again to get fastboot working.
While installing the dependencies, I get this:
W: Duplicate sources.list entry cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)/ oneiric/main i386 Packages (/var/lib/apt/lists/Ubuntu%2011.10%20%5fOneiric%20Ocelot%5f%20-%20Release%20i386%20(20111012)_dists_oneiric_main_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)/ oneiric/restricted i386 Packages (/var/lib/apt/lists/Ubuntu%2011.10%20%5fOneiric%20Ocelot%5f%20-%20Release%20i386%20(20111012)_dists_oneiric_restricted_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
Where do I go from here?

Remove CD-ROM reference from sources
Edit your sources and comment-out / turn off the references for the installation disk (CDROM/DVD). It should be the first thing you turn of after any install anyway. In my humble opinion.
Then run
sudo apt-get update
sudo apt-get -f install
this should resolve any pending issues and get you running.

skeltonh said:
Edit your sources and comment-out / turn off the references for the installation disk (CDROM/DVD).
Click to expand...
Click to collapse
How do I do that?
Sent from my R800i using XDA

Or can somebody can tell me what it means so I can Google it?
Sent from my R800i using XDA

I have a problem, when I try to use fastboot even in the platform-tools folder it says:
fastboot: command not found

On what OS? If it's Linux, you have to add a Dotslash to execute the file.
Swypesation

I have created udev rules as said above, but flashtool still says 'Add udev rules'.
What I am missing here. I'm using Ubuntu 12.04.
Any help is appreciated.

You must start flashtool with root acces

is rooting ur play a wise decission?

wat is better 4 my play, ics or gingerbreadman?

where/what is the search key on a mini pro?
Thanks

Big Thanks for this Tutorial Logesman. :good: Just wanted to add that I think...anyone having trouble installing SDK + Manager has to install Java JDK first. Yes, I got stuck at installing SDK.:silly: I tried to run android file in tools folder (as executable) which opens manager.
From Terminal:
sudo apt-get install openjdk-7-jdk openjdk-7-jre

i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:

roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium

install windows might be easier.
Sent from my Xperia Play using Tapatalk 2

roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
cyrusalmighty said:
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium
Click to expand...
Click to collapse
Have you tried running adb as root? (After a week of testing 12.04, I left to go back to 10.04, a much better release, imo)
Pax
Sent from my R800x using Tapatalk 2

IE-coRe said:
I have a problem, when I try to use fastboot even in the platform-tools folder it says:
fastboot: command not found
Click to expand...
Click to collapse
seems like you didn't path the fastboot command correctly, try check back again at your .bashrc
roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
same case as the above
cyrusalmighty said:
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium
Click to expand...
Click to collapse
would you mind telling what does the error says?

Related

How To Use ADB On Mac With Htc Hero

I've spent hours trying to workout how to use adb
I'm using Amon_RA's recovery image and want to run a BART backup but it forces you to use adb, which i can't workout
help please!!!
Did you download the Android SDK for OS X?
Please give us some more information, such as the steps you've taken and any errors or other information you get from the Terminal.
yes i have downloaded the sdk from the website
but everytime i even check what devices are connected etc it fails
i open terminal, drag the tools folder into it, it then ses its created a directory
when i try to put in the commands "adb devices" or "bart" however, it ses there is no such command
do i need to put my phone into recovery, or mass storage or something
im stumped
You need to add the tools directory to PATH variable on your computer
Here's how you do it (the alternative way is easier):
Run this in Terminal
Code:
cd
nano .bash_profile
a text editor will open. add this:
Code:
export PATH=${PATH}:/path-to-android-sdk/tools
where you replace "path-to-android-sdk" with the real path.
Alternatively you could run this command in the terminal:
Code:
echo -e "\nexport PATH=${PATH}:/path-to-android-sdk/tools" >> .bash_profile
What you have done is to tell the shell to also look inside the tools directory when entering a command
Oh, in addition to Repp's suggestions, I know in Linux (and I dunno about everyone else) I need to be root to run adb properly. So maybe become root on the Mac. To do so, you need to be an Admin user, not a regular user, and at the Terminal, type
Code:
sudo -s
and then enter your user password when prompted.
okay ive done that, i dont know if it came back with the right response tho
i tried the first method and got into the text editor, i then typed what you said and it returned no response, i dont know if this is correct?
if so what do i do next?
Rather than altering your path, you can also navigate to the sdk/tools directory and run adb like so:
Code:
./adb devices
But you have to be inside the directory where the "adb" command lies.
Also, see my note above regarding root users.
Aah sorry. Just save and exit (press Ctrl+X and answer yes to whether or not you want to save). You could also try the alternative way.
craig0r said:
Oh, in addition to Repp's suggestions, I know in Linux (and I dunno about everyone else) I need to be root to run adb properly. So maybe become root on the Mac. To do so, you need to be an Admin user, not a regular user, and at the Terminal, type
Code:
sudo -s
and then enter your user password when prompted.
Click to expand...
Click to collapse
I have always used it as normal user and it has worked. Don't know why you would need to be root
how dyou get into the directory?
i usually just drag the tools folder into terminal.
is this correct?
DaNiEl FrEnCh said:
how dyou get into the directory?
i usually just drag the tools folder into terminal.
is this correct?
Click to expand...
Click to collapse
At the Terminal type
Code:
cd /Users/YourUserName/path/to/android_sdk/tools/
./adb devices
Repp said:
I have always used it as normal user and it has worked. Don't know why you would need to be root
Click to expand...
Click to collapse
Yeah, it's weird, but it works for me.
You change directory in the terminal with the command cd. So if I wanted to go to the Desktop directory I would write:
Code:
cd ~/Desktop
(~ is like a shortcut for your home directory which is the same as the directory /Users/your-username)
Did any of the methods work (they should )?
to repp, ive done that, all i need to know now is how to use the bart backup function from Amon_RA's recovery image, in adb
craig0r said:
Yeah, it's weird, but it works for me.
Click to expand...
Click to collapse
And it doesn't if you're not root?
DaNiEl FrEnCh said:
to repp, ive done that, all i need to know now is how to use the bart backup function from Amon_RA's recovery image, in adb
Click to expand...
Click to collapse
And it worked?
Unfortunately I have never done that so I can't help you there
how can i check if it worked?
Just run adb from any directory which is not the tools directory.
For example:
Code:
cd
adb devices
where the first line (cd) changes directory to your home directory (the command cd without a path does that) and the other one should list connected devices. As long as it doesn't say
Code:
-bash: adb: command not found
or anything like that, you should be fine
EDIT: If you want to use adb, you don't have to do the "cd" part first. This time only
its working now i can seee what devices i have
Code:
Dans-MacBook:tools Dan$ ./adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT98DL900002 device
but the main reason i want to use it, is to use it with Amon_RA's recovery
i neeed to do a BART backup so i can switch from the 2.1 rom from lox too 3.0 from modaco
I have never used BART, but unless I'm mistaken, it does almost the same thing as a nandroid backup (?). You could try that instead. Don't know about Amon_RA, but it's possible from MoDaCo's fastboot (linked to and explained how to install here)
other than that, there's nothing I can do
Repp said:
And it doesn't if you're not root?
Click to expand...
Click to collapse
That's right. Probably something to do with permissions in /dev/. It doesn't bother me enough to go hunting the problem down.

[GUIDE] ADB for Noobs - How to get adb working !

A lot of people seem scared to use "adb" (Android Debug Bridge), or try it out and hit problems, then immediately give up.
I personally think that the method of rooting using adb (rage) is "better" than Visionary, because you have more control over the process and can see what it's doing. e.g. if there's an error message then you can see that, and ask for help.
But even if you don't use adb in rooting, it's still a very useful tool to have available. You can use it to run commands on your phone, copy files between your PC and phone, and to debug various issues that may occur at some point (plus lots more).
The guide in this first posting is for Windows, since I think this is what the majority of what people are using, and also it's what I use myself. Though you can use adb on Linux or Mac too. There's a Mac guide in the second posting, with a Linux guide "coming soon".
There are different ways to install adb. Below I list two methods, the first method I call "Complete", which involves installing the Android SDK (Software Development Kit), and the second "Quick" way. Either should be fine for rooting etc.
There's also a guide by gtrab in his useful FAQ posting (thanks !) HERE , which involves a very quick way to get it up and running (scroll down to the "Adb Mini Package" section).
INSTALLING ADB ON WINDOWS - METHOD A, THE "COMPLETE" WAY, USING THE SDK
Step 1
If you haven't done so already, then download and install HTC Sync from HTC's website.
You'll find it in the Support section for the Desire Z (works on the G2 too), e.g. at http://www.htc.com/www/help/htc-desire-z/#download.
This is HTC's software to sync various stuff from your phone to your PC, such as email, bookmarks etc. However, even if you don't need that stuff, HTC Sync has a bunch of USB drivers for your phone, and that's what we *do* need.
Step 2
Download and install the Android SDK (Software Development Kit) Starter package from http://developer.android.com/sdk/index.html
There are two choices for Windows there, a simple zip file which you can unzip somewhere appropriate on your PC (e.g. put it on C:\ if you like). Or there's an installer (which is the recommended option according to the Android website), though that forces you to download some Java stuff which we don't really need for adb and takes a lot longer to install (but there won't be any harm in getting). It doesn't really matter which one you pick though.
You can read all about how to install the SDK at http://developer.android.com/sdk/installing.html . Ignore all the stuff about Eclipse though, you don't need that unless you're going to start writing Android apps.
Step 3
Now we need to add the Platform Tools component to the SDK, because that contains adb.
Run "SDK Manager" on your PC. You will find that in the root directory of the SDK, so you can open up a file explorer window to find that, then double-click on "SDK Manager" to run it.
Wait for a few seconds while it checks on the Android website for updates etc, let it then pop up with a window showing you what is on offer.
Add the "Android SDK Platform Tools", you can "reject" (i.e. don't install) all the other things it offers you if you like, though there's no harm in installing them (just takes up disk space on your PC).
Step 4
Now we need to update your Path variable. This lets you run adb on your PC from a command window no matter which directory you are in (which makes things a lot easier). If you don't setup your Path, then every time you want to run adb, you will either have to type the whole long pathname where you put adb, or cd to where you've put adb and run it from there (which could be inconvenient if you are transferring files to/from your phone).
On your PC, right-click on "My Computer" and select "Properties". (on Vista, click on "Change Settings"). Go to the "Advanced" tab, then select "Environment Variables". Find the "Path" variable in the list of variables that it shows (you might need to scroll), and then double-click on that entry to edit it. Add the full path of the "tools" and "platform-tools" folders of the SDK to your path. e.g. if the SDK has been installed in "c:\Program Files\android-sdk-windows", then add to your Path "c:\Program Files\android-sdk-windows\tools;c:\Program Files\android-sdk-windows\platform-tools" (Please Note - don't put any spaces between the semi-colon and pathname, otherwise it won't work !)
Step 5
On your phone, go into Menu->Settings->Applications->Development and make sure you have the entry "USB Debugging" ticked. adb will not work without this.
Step 6
Plug your phone into your PC using the original HTC cable. This is important, do not use a third-party cable since it might not work with adb (even though it might seem fine with other communication with your phone). If this is the first time you've done it since installing HTC Sync, you might have to wait while it installs additional drivers.
Step 7
Fire up a command prompt on your computer, e.g. "Run" then "cmd", or pick the "Command prompt" option from the menus, and type in the following (obviously the C:\> bit is your actual PC's prompt, not what you type). To emphasise, you are running this on your PC, not directly from your phone (e.g. terminal emulator) :
Code:
C:\> adb devices
This should display something like the following :
Code:
List of devices attached
XXX12345 device
... where the "XXX12345" bit is actually your phone's serial number. If the list is blank and the phone is plugged in ok, go back to Step 5 and make sure USB Debugging is enabled. If you can see your phone, then you're in business, adb can see your phone and communicate with it, and you're ready to start using adb !
By the way, the first adb command that you type may well also come up with some lines similar to "adb deamon out of date" etc, but don't worry, that's normal, just check the rest of the output.
INSTALLING ADB ON WINDOWS - METHOD B, THE "QUICK" WAY, NO SDK
Thanks to amroush_1800 for the input on this.
Step 1
If you haven't done so already, then download and install HTC Sync from HTC's website.
You'll find it in the Support section, e.g. at http://www.htc.com/uk/supportdownloadlist.aspx?p_id=325&act=sd&cat=all.
This is HTC's software to sync various stuff from your phone to your PC, such as email, bookmarks etc. However, even if you don't need that stuff, HTC Sync has a bunch of USB drivers for your phone, and that's what we *do* need.
Step 2
Download this zip archive and unzip it somewhere memorable on your PC (e.g. into a folder on your desktop) - http://dl-ssl.google.com/android/repository/platform-tools_r04-windows.zip
Step 3
On your phone, go into Menu->Settings->Applications->Development and make sure you have the entry "USB Debugging" ticked. adb will not work without this.
Step 4
Plug your phone into your PC using the original HTC cable. This is important, do not use a third-party cable since it might not work with adb (even though it might seem fine with other communication with your phone). If this is the first time you've done it since installing HTC Sync, you might have to wait while it installs additional drivers.
Step 5
Fire up a command prompt on your computer, e.g. "Run" then "cmd", or pick the "Command prompt" option from the menus.
Use the "cd" command to change to the folder that contains the adb.exe and other files that you unzipped in Step 2.
Then type in the following (obviously the C:\> bit is your actual PC's prompt, not what you type). To emphasise, you are running this on your PC, not directly from your phone (e.g. terminal emulator) :
Code:
C:\> adb devices
This should display something like the following :
Code:
List of devices attached
XXX12345 device
... where the "XXX12345" bit is actually your phone's serial number. If the list is blank and the phone is plugged in ok, go back to Step 3 and make sure USB Debugging is enabled. If you can see your phone, then you're in business, adb can see your phone and communicate with it, and you're ready to start using adb !
By the way, the first adb command that you type may well also come up with some lines similar to "adb deamon out of date" etc, but don't worry, that's normal, just check the rest of the output.
INSTALLING ADB ON MAC
The following excellent guide kindly provided by siedkins, please thank him and not me !
What you will need:
A Mac
USB cable
Android SDK for OSX- http://developer.android.com/sdk/index.html
At the time of writing this the version was "android-sdk_r08-mac_86" so please have a look at the above link and let me know if you can't find that same version.
So download the zip file and I would extract it to a folder where you are happy to keep it such as within your user home folder i.e. Macintosh HD/Users/{Your User Name} and for my mac it is Users/siedkins which is how I have my OSX set up.
Then open then still in Finder, open "android-sdk-mac_86" then "tools".
Now launch Terminal - ⌘ + space then type Terminal or Applications>Utilities>Terminal
Now drag and drop the file called "android" in the "tools" folder into your terminal window and you should see something like:
/Users/siedkins/android-sdk-mac_86/tools/android
Then hit enter - this should load Android SDK
Next go to Available Packages on the left and Android Repository > Android SDK Platform-tools, revision 1 -tick the box and hit "Install Selected"
It should download and install the Platform Tools which includes ADB !!!!
Now quit Android SDK after it has downloaded and go back into Finder. Now you should see a new folder "platform-tools" in the "android-sdk-mac_86" folder. Open that and you can now see a file called adb.
Now .... I am going to show you how to make your life a lot easier in Terminal to run ADB without having to navigate to the folder every time you want to launch it.
Go back to your Terminal window and type (or copy & paste):
Code:
cd ~
The screen should then look like
NAME_OF_YOUR_MACHINE:~ USERNAME$
For me I have:
Mac-Pro:~ siedkins$
Next, type
Code:
touch .bash_profile
to create your new bash / path file
Next, type
Code:
open -e .bash_profile
to open it in TextEdit.
Now into Text Edit please copy:
Code:
export PATH=${PATH}:
Then go into Finder and navigate your your "android-sdk-mac_86" folder. Then click on the "platform-tools" folder and drag and drop this into TextEdit at the end of the code above that you copied. Mine looks like:
export PATH=${PATH}:/Users/siedkins/android-sdk-mac_86/platform-tools/
Yours should look like:
export PATH=${PATH}:insert your path to the "platform-tools" folder in your Android SDK here
All you need is that one line. Then Save and exit TextEdit and then very importantly QUIT TERMINAL.
Now ........ to turn on USB Debugging in your handset Settings > Applications > Development > USB Debugging - ticked and also go to Settings > Connect to PC > Default connection type > Charge Only and also UNTICK "Ask me ..." there also. You can always go back here and change these settings back.
Now plug in your phone to a USB port. I noticed that if I plugged my phone into one of the standard USB ports on the front of my machine I couldn't see the phone further down the line and if I plugged it into a powered USB port on the front (I have an "akasa AK-ICR-08" which has a powered connector behind the 5 USB ports. But you guys will probably be using a MacBook or MacPro and there shouldn't be any issues with the power to your USB ports.
Now to launch ADB - re-open terminal (remember that you had quit it - very important!) then type in:
Code:
adb devices
And you should see:
List of devices attached
HXXXXXXXXXX device
where XXXXXXXX is your unique phone ID.
Now you can run all of your favourite ADB commands straight by typing:
adb shell
etc straight into Terminal. I won't go into that here as there are plenty of guides about what to do with ADB once it's installed!
Now you have ADB setup on your Mac and can run it without the need for installing HTC Sync - un-installing it - loading some modified drivers over the top !!!!
It all just works !!!!!!
INSTALLING ADB ON LINUX
Coming soon ...
USING ADB
There's a comprehensive guide to using adb, including all its commands, at http://developer.android.com/guide/developing/tools/adb.html
Here are a few example commands :
Code:
C:> adb push hello.txt /data/local/tmp
The above copies the file hello.text from the current directory of your PC (i.e. the directory shown in the command prompt) into the /data/local/tmp directory on your phone.
Code:
C:\> adb pull /sdcard/error.log error.log
The above copies the file /sdcard/error.log onto your PC.
Code:
C:\> adb install Superuser.apk
The above installs the app in the Superuser.apk file in the current directory of your PC, onto your phone.
Code:
C:\> adb shell
The above starts a command prompt session on your phone. So when you see the $ prompt, that's your phone and commands you type there will be executed on your phone.
Code:
C:\> adb shell ls
The above runs the command "ls" on your phone and displays the results. So it's a way of issuing one command at a time, without starting your own shell session. You can subsitute other shell commands for the "ls".
Code:
C:\> adb reboot
The above reboots the phone.
Code:
C:\> adb reboot bootloader
The above reboots the phone into the bootloader (hboot).
Code:
C:\> adb reboot recovery
The above reboots the phone into recovery.
USING ADB FOR DIAGNOSTICS (logcat)
Coming soon ...
Thank god! Lol thanks for all your hard work.
Sent from my HTC Vision using XDA App
Get a "how to logcat" section added.
Nice work. Can we elect you to be a mod?
Sent from my HTC Vision using XDA App
ddotpatel said:
Get a "how to logcat" section added.
Click to expand...
Click to collapse
Thanks for the suggestion, will do
Nice dude. Just what I needed
Sent from my HTC Desire using XDA App
+1 mod vote!
Sent from my HTC Vision using XDA App
Nice guide mate. Let me know if you need any more posts or help in any way
steviewevie said:
Using adb
Using adb for logcat
adb logcat
Or
adb lolcat
Click to expand...
Click to collapse
Also update it for Mac / Linux users.
Mainly different adb files (I had adb and fastboot for Win/Mac/Lin uploaded somewhere, if you want?) and they go in /system/bin instead of PATH.
Otherwise, good idea + well done.
DanWilson said:
Also update it for Mac / Linux users.
Mainly different adb files (I had adb and fastboot for Win/Mac/Lin uploaded somewhere, if you want?) and they go in /system/bin instead of PATH.
Otherwise, good idea + well done.
Click to expand...
Click to collapse
Thanks. I need someone to help me come up with the different steps for Mac/Linux users please ? Then I can add those in.
steviewevie said:
Thanks. I need someone to help me come up with the different steps for Mac/Linux users please ? Then I can add those in.
Click to expand...
Click to collapse
I'll do that.
I'll also hunt down my Mediafire adb and fastboot files, because not everyone wants the whole SDK
I don't know if you need any drivers for the phone (like HTC Sync for Windows). Someone else will need to tell you, or you can wait till Christmas.
INSTALLING ADB
Step 0
Drivers perhaps? XD
Step 1
Download these files;
Mac - http://www.mediafire.com/?z8myxs9941kz3gg
Linux - http://www.mediafire.com/?m62rt943mroxm4s
Or you can download and install the Android SDK (Software Development Kit) Starter package from http://developer.android.com/sdk/index.html
You can read all about how to install the SDK at http://developer.android.com/sdk/installing.html . Ignore all the stuff about Eclipse though, you don't need that unless you're going to start writing Android apps.
Now, from version 8 (Android 2.3) of the SDK onwards, adb has been taken out of this starter package. If you downloaded version 7 (Android 2.2), then you've already got adb and you can skip Step 3 and go straight to Step 4 below. Otherwise you need to proceed to Step 3 to add adb to the SDK.
Step 2
Extract the files and rename "adb-linux" ("adb-mac") to "adb" and "fastboot-linux" ("fastboot-mac") to "fastboot"
You could call it anything you like, like "cheese" and "bread", but that makes things difficult.
Step 3
Mac - Copy the files to the folder /bin
You will need to unhide the folder. Google it.
Linux - Copy the files to /system/bin *OR* /bin
I have not used Linux for ages so my folders are rotting away. I believe you will need root access to do this, I used Kongregate (I think) as an app to control my root copying needs.
Step 4
On your phone, go into Menu->Settings->Applications->Development and make sure you have the entry "USB Debugging" ticked. adb will not work without this.
Step 5
Plug your phone into your PC using the original HTC cable. This is important, do not use a third-party cable since it might not work with adb (even though it might seem fine with other communication with your phone). Or whatever.
Step 6
Open a Terminal window. On your PC/Mac. To emphasise, you are running this on your PC, not directly from your phone (e.g. terminal emulator) :
The part were it says "Dan-Wilsons-MacBook:~ danwilson$" will probably not be on your PC/Mac, unless you are called Dan Wilson, and have a MacBook.
Code:
Dan-Wilsons-MacBook:~ danwilson$ adb devices
This should display something like the following :
Code:
List of devices attached
XXX12345 device
... where the "XXX12345" bit is actually your phone's serial number. If the list is blank and the phone is plugged in ok, go back to Step 6 and make sure USB Debugging is enabled. If you can see your phone, YOU WIN A CHEESECAKE!
If you decided to be awkward and call "adb-linux" ("adb-mac") "cheese", replace the word "adb" in command lists (like the above) to "cheese". It looks cool but complicates things.
Example;
Code:
Dan-Wilsons-MacBook:~ danwilson$ cheese devices
-------------
I think this looks OK. Some bits are weird and I don't know about drivers, but still, better than nothing. It is rough, but I've not done it in ages. Sorry bout that.
Here is the adb and fastboot files for Windows. Check they work with the Z before throwing them in the first post. If you do.
http://www.mediafire.com/?zlbyfbaaf5lrj8i
I've updated this guide to flesh it out a bit more (still more to be done though).
Significantly, please note that in the latest version of the SDK (i.e the one for Android 2.3), they have taken adb *out* of the Starter version of the SDK. So now there's an additional step, which is downloading the "Platform Tools" component of the SDK. It's all in the guide though.
nice, this needs to be "stickied"..
steviewevie...
whatever you are on.. can i haz some?
you are poster of the year! wow, such effort.
this beeyotch must be stickied all over the world.
EDIT -- i dont see "adb pull /" so as to dump all your files from system data etc into your sdk folder. if i missed that nevermind!
@steviewevie:
My 2 cents for your great work:
I have tested and uploaded a Mini ADB package and the ADB USB drivers for Windows Vista / Windows 7, to the Resources Centre, easy tutorial + FAQs thread here:
http://forum.xda-developers.com/showthread.php?t=835777
I thought this would make things easier for newbies or people who don't want to download the whole SDK / Sync software
Also, setting the path is not required, since the "Runme" file is located inside the same folder within the ADB files
This could save some steps for newbies
If you find it helpful, feel free to link from your guide
Thanks for the input guys, I have some updating to do !
steviewevie said:
INSTALLING ADB - METHOD B, THE "QUICK" WAY, NO SDK
Step 2
Download the adb binary from ? * to be completed *
Click to expand...
Click to collapse
Direct Download Links for Android SDK Platform-tools, revision 1
ht*p://dl-ssl.google.com/android/repository/platform-tools_r01-windows.zip
ht*p://dl.google.com/android/repository/platform-tools_r01-windows.zip
It contains ADB.exe and needed dlls
size 3.06 MB
Also i recommend ADBMagic from Chainfire if you got tired of using ADB commands by hand for a lot of operations
ht*p://forum.xda-developers.com/showthread.php?t=746313
Have fun
if you add adb.exe to system32 folder is windows u can adb from anywhere in command prompt.. just in case adding the variables dont work

[GUIDE] Using ADB & FASTBOOT in OSX / Mac

Hi,
I thought I'd add this here because I've recently starting using OSX after building my own hackintosh out of PC parts. I got very fed up with Windows and the need for drivers all over the shop so I'm moved over now.
I've also just got into flashing my HTC Desire and it was made very easy by lots of the guys here. One thing that will always be useful when rooting and flashing your phone is ADB. There are lots of guides out there for ADB on Windows but I wanted to run in natively in OSX.
After a lot of research and a few failed attempts .... I've now worked out how to run ADB in OSX.
What you will need:
A Mac
USB cable
Android SDK for OSX- http://developer.android.com/sdk/index.html
At the time of writing this the version was "android-sdk_r08-mac_86" so please have a look at the above link and let me know if you can't find that same version.
So download the zip file and I would extract it to a folder where you are happy to keep it such as within your user home folder i.e. Macintosh HD/Users/{Your User Name} and for my mac it is Users/siedkins which is how I have my OSX set up.
Then open then still in Finder, open "android-sdk-mac_86" then "tools".
Now launch Terminal - ⌘ + space then type Terminal or Applications>Utilities>Terminal
Now drag and drop the file called "android" in the "tools" folder into your terminal window and you should see something like:
/Users/siedkins/android-sdk-mac_86/tools/android
Then hit enter - this should load Android SDK
Next go to Available Packages on the left and Android Repository > Android SDK Platform-tools, revision 1 -tick the box and hit "Install Selected"
It should download and install the Platform Tools which includes ADB !!!!
Now quit Android SDK after it has downloaded and go back into Finder. Now you should see a new folder "platform-tools" in the "android-sdk-mac_86" folder. Open that and you can now see a file called adb.
Now .... I am going to show you how to make your life a lot easier in Terminal to run ADB without having to navigate to the folder every time you want to launch it.
Go back to your Terminal window and type (or copy & paste):
Code:
cd ~
The screen should then look like
NAME_OF_YOUR_MACHINE:~ USERNAME$
For me I have:
Mac-Pro:~ siedkins$
Next, type
Code:
touch .bash_profile
to create your new bash / path file
Next, type
Code:
open -e .bash_profile
to open it in TextEdit.
Now into Text Edit please copy:
Code:
export PATH=${PATH}:
Then go into Finder and navigate your your "android-sdk-mac_86" folder. Then click on the "platform-tools" folder and drag and drop this into TextEdit at the end of the code above that you copied. Mine looks like:
export PATH=${PATH}:/Users/siedkins/android-sdk-mac_86/platform-tools/
Yours should look like:
export PATH=${PATH}:insert your path to the "platform-tools" folder in your Android SDK here
All you need is that one line. Then Save and exit TextEdit and then very importantly QUIT TERMINAL.
***** If you have issues being able to save the file at all then please jump to the bottom of the post*****
Now ........ to turn on USB Debugging in your handset Settings > Applications > Development > USB Debugging - ticked and also go to Settings > Connect to PC > Default connection type > Charge Only and also UNTICK "Ask me ..." there also. You can always go back here and change these settings back.
Now plug in your phone to a USB port. I noticed that if I plugged my phone into one of the standard USB ports on the front of my machine I couldn't see the phone further down the line and if I plugged it into a powered USB port on the front (I have an "akasa AK-ICR-08" which has a powered connector behind the 5 USB ports. But you guys will probably be using a MacBook or MacPro and there shouldn't be any issues with the power to your USB ports.
Now to launch ADB - re-open terminal (remember that you had quit it - very important!) then type in:
Code:
adb devices
And you should see:
List of devices attached
HXXXXXXXXXX device
where XXXXXXXX is your unique phone ID.
Now you can run all of your favourite ADB commands straight by typing:
adb shell
etc straight into Terminal. I won't go into that here as there are plenty of guides about what to do with ADB once it's installed!
Now you have ADB setup on your Mac and can run it without the need for installing HTC Sync - un-installing it - loading some modified drivers over the top !!!!
It all just works !!!!!!
Please drop me a line if you have any queries about this !
******************
If you are have user account issues such as Terminal or TextEdit says that you can't do anything then try adding "sudo" to the front of your terminal command as this will allow you to execute the account as a superuser or root user for OSX! ROOT!!! Note that you will have to enter your password to enable the superuser access rights and you won't see anything as you type in your password.
i.e. try:
Code:
sudo touch .bash_profile
then
Code:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit .bash_profile
(slight change in the coding here to ensure that TextEdit opens
Or you could do:
Code:
sudo pico .bash_profile
This will open up the Pico text editor instead of TextEdit. Here you will have to type out all of the text then you press "ctrl+x" to exit and then you can save on the next screen. To check that has worked you can then open the file in terminal again and check it with the normal command:
Code:
open -e .bash_profile
******************
Please see post #37 for How To Use ADB Over WIRELESS !!!!
************************************************************************
EDIT - 27th JAN 2010
FastBoot
I've now found you all a precompiled version of Fast Boot:
http://developer.htc.com/adp.html
Please download and unzip the precompiled version for OSX to your "SDK/platform-tools" folder.
Rename the unzipped file from "fastboot-mac" just to "fastboot". You need to fix the permissions of the fastboot file using CHMOD in Terminal.
In Terminal navigate to your "SDK/platform-tools" folder and then type:
Code:
ls
You should see all of the files in your "platform-tools" folder such as adb, aapt, fastboot, etc.
Then type:
Code:
chmod 777 fastboot
PLEASE NOTE THAT I AM ASSUMING THAT YOU HAVE CHANGED THE FILE NAME ABOVE !
Now with the permissions fixed you should be able to run fastboot.
Connect your phone via USB and set to "charging only". Then turn off your phone and leave the USB in. Then hold the back key and then turn your phone on again. You will have a white screen with 3 skateboarding androids on.
Now in Terminal type:
Code:
fastboot devices
And you should see your unqiue phone ID! (Note that you have to be at that white screen with the skateboarders for the "fastboot devices" code to run!
Now you have a fully working fastboot !!!
Sorry this explanation is a bit short - I did write out a longer one but my browser crashed and I lost it all. However if you cannot follow the above then I think it's maybe best that you don't use fastboot as you could seriously brick your phone.
NOTE - I HAVE NEVER USED FASTBOOT TO FLASH A RADIO OR PHONE SO I PROBABLY WON'T BE ABLE TO HELP IF YOU GET ERRORS IN USING FASTBOOT OR FLASHING YOUR DEVICE ! The above information is how to shortcut the navigation to the folder. Please don't blame me if you break the recovery image of your phone!
Thanks for such a thorough step by step guide. But Im having a problem I followed the directions and at the last step I get "permission denied". Any tips for me would be truly appreciated. Thanks
dhoshman said:
Thanks for such a thorough step by step guide. But Im having a problem I followed the directions and at the last step I get "permission denied". Any tips for me would be truly appreciated. Thanks
Click to expand...
Click to collapse
which last step ?
dhoshman said:
Thanks for such a thorough step by step guide. But Im having a problem I followed the directions and at the last step I get "permission denied". Any tips for me would be truly appreciated. Thanks
Click to expand...
Click to collapse
What version of MacOS? Also are you sure your device is properly rooted? I'm assuming you are getting the error when typing "adb devices"?
EDIT: That's what I get for being distracted while typing this.. ;-)
The easiest way to get the sdk is by using homebrew, which is an amazingly useful tool. https://github.com/mxcl/homebrew
Code:
brew install android-sdk
It doesn't add adb to your path however, you have to do that manually by adding /usr/local/Cellar/android-sdk/r8/platform-tools to your path.
Hope that makes it a little bit easier.
I found that on my mac using terminal I have to always start the adb commands with a ./ otherwise it wouldn't work right. This might be common knowledge for some, but I'm a terminal newbie
So, for example:
./adb devices
Thanks for the walk through
This work great. I put the the SDK folder on the root of Macintosh HD and renamed it to AndroidSDK. Then in the .bash_profile my path was /AndroidSDK/platform-tools/ . I then made a backup of my SD card with adb pull from /mnt/sdcard to my local machine.
mun-key said:
I found that on my mac using terminal I have to always start the adb commands with a ./ otherwise it wouldn't work right. This might be common knowledge for some, but I'm a terminal newbie
So, for example:
./adb devices
Click to expand...
Click to collapse
Kind of weird. To me that would mean that you're path variable isn't setup correctly. Usually the ./ before a command means to run the command from the current directory and ignore the path variable.
It doesn't even have to be this complicated. Download the sdk, whatever files you want to push to your phone put it in the same folder. Then do the commands (./adb push). Simple.
Great and easy tutorial! Got it working in 5min ^_^
madj42 said:
Kind of weird. To me that would mean that you're path variable isn't setup correctly. Usually the ./ before a command means to run the command from the current directory and ignore the path variable.
Click to expand...
Click to collapse
Ok - that makes sense now. And reading Krisrk's reply, that's exactly how I did it.
On my device I only needed to push a single file. Don't really need adb anymore. Your post was like 12-hours too late for me though. I spent 3 hours trying to figure out why it wouldn't work, then saw the ./ in a youtube video. After that I was rooted with a new rom in minutes
thanks for all the great info guys
Just wanted to thank you! I already had ADB working on my Mac OSX but didn't have the "environment variables" in the .bash_profile. So now I can just use adb commands directly without going into the finder and find the adb!
Also, kudos for the very detailed guide with your own examples, that reads very well!
Thanks for the comments guys.
I know that you can navigate to the SDK folder and just run it from there but I thought that people might like the above guide to do the shortcut once and then never have to jump around folders again in terminal which is a bit of a pain. Plus my method removes the need for the "./" prefix.
anyways I'm easy I'm sure that everyone will have their own preferred method if you already use adb on OSX
i cannot get beyond the command:
touch .bash_profile
the terminal returns permission denied. what do i need to add or what am i doing wrong?
What type of user account do you have set up in OSX?
System Prefs > Accounts
Also what about trying the following in Terminal
Code:
sudo touch .bash_profile
And then enter the password for your user profile?
Any better?
Thanks for this!!!!!
Nobody ever shows macs love.
Sent From My HTC Evo 4G Using Tapa Talk Pro!
siedkins said:
What type of user account do you have set up in OSX?
System Prefs > Accounts
Also what about trying the following in Terminal
Code:
sudo touch .bash_profile
And then enter the password for your user profile?
Any better?
Click to expand...
Click to collapse
it popped up and asked my password, then it said i entered the wrong one and i never was asked this again. this is incredibly frustrating as i cannot even get it to work in windows
edit: ok got to the part where i bring up text edit, but it will not let me save. states i do not have permission to save. is there a way i can turn off this password crap for the time being? all i want to do is push files to my phone, i can't even get this far
Ok...
I'm trying not to look stupid, but for gods sake, im stuck at the first command. I copy paste cd~ and nothing happens. press enter nothing. I've been reading up on terminal and i still feel quite stupid considering how im stuck on step one
edit: got it! I got lost going back into the same terminal and not closing the android sdk window. there fore I was still in the sdk and not telling the computer anything. a dur. Opening a new terminal and doing all of the steps did the trick. Thanks for this btw!
thanks for the detailed guide. i've been looking all over the web for a guide to setup adb for MAC. followed the steps here and now, i'm able to use ADB on my macbook. YAY!!
monstereo said:
thanks for the detailed guide. i've been looking all over the web for a guide to setup adb for MAC. followed the steps here and now, i'm able to use ADB on my macbook. YAY!!
Click to expand...
Click to collapse
Hey just a random note, nice prof pic stig ftw

[Q] Mac equivalent to flashtool?

Is there a Mac equivalent to FlashTool?
I also have the same question.
Hi there mmzubair!
In the end the best solution I found was just to install windows XP with bootcamp! Or if your Macs newer than mine (using a 4 year old Mac Mini) you could install XP using parallels so you don't have to rebooting every time you want to flash your phone!
Sent from my R800i using Tapatalk 2
I'm wondering if you can install and run flashtool with Wine?
Sent from my R800x using Tapatalk 2
beez1717 said:
I'm wondering if you can install and run flashtool with Wine?
Sent from my R800x using Tapatalk 2
Click to expand...
Click to collapse
I believe you can't because wine can't install driver software.
flashtool linux
the flashtool site explains a method of installing it on linux based systems, but it all sounds gibberish to me (because im a noob) and i cannot understand it, has anybody done this? please explain in pure english if possible. thank you.
Flashtool on Mac instructions
!! UPDATE, ALL
There is a flashtool for mac on androxyde's github.
Basically...
You need (in this order):
1/ Xcode, Download and install it from App store/your mac's supplied DVD/Apple developer website
> If using version 3 and earlier, make sure the "UNIX Development", "System Tools", "Command Line Tools", or "Command Line Support" is selected during the installation process,
> If using version 3 and earlier, Apple's Command Line Developer Tools are found at the Apple Developer Connection site
2/ MacPorts, See section 2 on http://www.macports.org/install.php.
Then:
3/ Download and unzip flashtool from androxyde's github
More prep work for the USB stuff:
4/ Open Terminal and type/run code:
Code:
ls -la /opt/local/lib/libusb-1.0.dylib
If "no file or directory" found then run code:
Code:
sudo port install libusb
Now, to run Flashtool (ASSUMING YOU DID NOT RENAME THE FLASHTOOL FOLDER AND PROGRAM NAME SINCE UNZIP!):
5/ Open Terminal and type/run code:
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib; */Flashtool/FlashTool;
or
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib; ~/Downloads/Flashtool/FlashTool;
Alternatively:
> Open up the "Flashtool" Unix Executable File in TextEdit
> Copy and paste
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
the the line directly underneath export OS=$(uname -s)
> Save it, and from now on, double click the FlashTool executable file to open flashtool
6/ Flashtool window should pop up and a smile appears on your face
Maintenance
7/ To update MacPorts and installed ports, open terminal and run:
Code:
sudo port -v selfupdate; sudo port -v upgrade outdated;
Themindbuddah said:
Is there a Mac equivalent to FlashTool?
Click to expand...
Click to collapse
J0YU said:
There is a flashtool for mac on androxyde's github.
Basically...
You need (in this order):
1/ Xcode, Download and install it from App store/your mac's supplied DVD/Apple developer website
2/ MacPorts, See section 2 on http://www.macports.org/install.php.
Then:
3/ Download flashtool from androxyde's github
More prep work for the USB stuff:
5/ Open Terminal and type/run code:
Code:
ls -la /opt/local/lib/libusb-1.0.dylib
If "no file or directory" found then run code:
Code:
sudo port install libusb
6/ Last line of code to run in Terminal for prep:
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
Now run Flashtool:
7/ Open the Flashtool folder which you unzipped in 3/
8/ Double click on "Flashtool" (Unix Executable File)
Hopefully that helps, haven't tried it out personally because I'm too lazy for 1/ and 2/ but reply/thanks if it works out fine!
Maintenance
9/ To update MacPorts, open terminal and run:
Code:
sudo port -v selfupdate
Click to expand...
Click to collapse
That's right there is a FlashTool Mac Edition check it out: http://androxyde.github.com/
Thanks for the post. The LD_LIBRARY_PATH variable was the key for me. With the 2 mods for steps 6 & 8 in bold, these directions worked on my MacBook Air. FlashTool now comes up and runs!
-- Cronin
6/ Last line of code to run in Terminal for prep:
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
Becomes:
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
​
Now run Flashtool:
7/ Open the Flashtool folder which you unzipped in 3/
8/ Double click on "Flashtool" (Unix Executable File)
Becomes:
go to your FlashTool folder
Code:
cd ../FlashTool
​execute the FlashTool:
Code:
- ./Flashtool
​
J0YU said:
There is a flashtool for mac on androxyde's github.
Basically...
You need (in this order):
1/ Xcode, Download and install it from App store/your mac's supplied DVD/Apple developer website
2/ MacPorts, See section 2 on http://www.macports.org/install.php.
Then:
3/ Download flashtool from androxyde's github
More prep work for the USB stuff:
5/ Open Terminal and type/run code:
Code:
ls -la /opt/local/lib/libusb-1.0.dylib
If "no file or directory" found then run code:
Code:
sudo port install libusb
6/ Last line of code to run in Terminal for prep:
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
Now run Flashtool:
7/ Open the Flashtool folder which you unzipped in 3/
8/ Double click on "Flashtool" (Unix Executable File)
Hopefully that helps, haven't tried it out personally because I'm too lazy for 1/ and 2/ but reply/thanks if it works out fine!
EDIT: check out the post below for more info/stuff
Maintenance
9/ To update MacPorts, open terminal and run:
Code:
sudo port -v selfupdate
Click to expand...
Click to collapse
I followed this guide and tried the other variation but when i launch flashtool this happen:
Macbook:~ Suz$ /Users/Suz/Downloads/FlashTool/FlashTool ; exit;
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'usb-1.0': dlopen(libusb-1.0.dylib, 9): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:179)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:252)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.Native.loadLibrary(Native.java:353)
at se.marell.libusb.jna.LibUsb.<clinit>(LibUsb.java:11)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:36)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:73)
at linuxlib.JUsb.init(JUsb.java:38)
at gui.FlasherGUI.main(FlasherGUI.java:170)
logout
[Processo completato]
nothing else! Where am I doing wrong?
smayor said:
I followed this guide and tried the other variation but when i launch flashtool this happen:
Macbook:~ Suz$ /Users/Suz/Downloads/FlashTool/FlashTool ; exit;
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'usb-1.0': dlopen(libusb-1.0.dylib, 9): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:179)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:252)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.Native.loadLibrary(Native.java:353)
at se.marell.libusb.jna.LibUsb.<clinit>(LibUsb.java:11)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:36)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:73)
at linuxlib.JUsb.init(JUsb.java:38)
at gui.FlasherGUI.main(FlasherGUI.java:170)
logout
[Processo completato]
nothing else! Where am I doing wrong?
Click to expand...
Click to collapse
i have the same problem can someone help me?
currently trying to diagnose it, I got the same problem too xD
The problem is that instead of */Flashtool/Flashtool you should replace before * with the the path from root to the file.
On my system this was:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib; /Users/<username>/Downloads/Flashtool/FlashTool;
Was getting same error and then it loaded
edit--
In fact, just open FlashTool in text wrangler or another editor and paste this in:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
after line:
export OS=$(uname -s)
save that and it should work. I did this, then I got an app got Platypus and wrapped the whole thing into a .app file. I'd upload it but it is 80 megs and I have a quarter meg upload rate
You could probably put that jar on the same path as the other files and it would find it, and save others going through the other steps but I'm not sure. I've not had time to try.
brim4brim said:
The problem is that instead of */Flashtool/Flashtool you should replace before * with the the path from root to the file.
On my system this was:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib; /Users/<username>/Downloads/Flashtool/FlashTool;
Was getting same error and then it loaded
edit--
In fact, just open FlashTool in text wrangler or another editor and paste this in:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib
after line:
export OS=$(uname -s)
save that and it should work. I did this, then I got an app got Platypus and wrapped the whole thing into a .app file. I'd upload it but it is 80 megs and I have a quarter meg upload rate
You could probably put that jar on the same path as the other files and it would find it, and save others going through the other steps but I'm not sure. I've not had time to try.
Click to expand...
Click to collapse
oops, did the unix wildcard " * " not work on your machine? yeah it's either that or
Code:
~/Downloads/Flashtool/FlashTool
should also work. Thanks for the heads up, might update my tutorial more to cover more stuff and maybe release a moded FlashTool executable, I'm not sure
J0YU said:
oops, did the unix wildcard " * " not work on your machine? yeah it's either that or
Code:
~/Downloads/Flashtool/FlashTool
should also work. Thanks for the heads up, might update my tutorial more to cover more stuff and maybe release a moded FlashTool executable, I'm not sure
Click to expand...
Click to collapse
I hope you guys can help, I tried using the methods you gave (exporting the var and updating the file in textwrangler) but I'm still getting the error below. Would you know how to get around this?
I checked and I do have the file:
Users-iMac:FlashTool user$ ls -la /opt/local/lib/libusb-1.0.dylib
lrwxr-xr-x 1 root admin 18 May 12 00:25 /opt/local/lib/libusb-1.0.dylib -> libusb-1.0.0.dylib
Error below:
Last login: Sat Nov 3 00:47:57 on ttys001
Users-iMac:~ user$ /Users/user/Downloads/FlashTool/FlashTool ; exit;
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'usb-1.0': dlopen(libusb-1.0.dylib, 9): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:179)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:252)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.Native.loadLibrary(Native.java:353)
at se.marell.libusb.jna.LibUsb.<clinit>(LibUsb.java:11)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:36)
at se.marell.libusb.LibUsbSystem.<init>(LibUsbSystem.java:73)
at linuxlib.JUsb.init(JUsb.java:38)
at gui.FlasherGUI.main(FlasherGUI.java:170)
logout
[Process completed]
---------- Post added at 01:21 AM ---------- Previous post was at 01:02 AM ----------
Somehow, double clicking on FlashTool gives me that error... But doing a ./FlashTool in the terminal works. Thanks!
Would you guys happen to know if a Mac version of the rooting toolkit is available?
Somehow, double clicking on FlashTool gives me that error... But doing a ./FlashTool in the terminal works. Thanks!
Would you guys happen to know if a Mac version of the rooting toolkit is available?
Click to expand...
Click to collapse
Are you talking about ADB and FlashTool for mac?
Or like the actual rooting stuff like Superuser.apk and BusyBox (root_tools.rar in the attached files)?
Use wine
Sent from my R800x using xda app-developers app
problems with libusb
Hi guys,
thank you so much for this guide,
I have a problem when i try to open flash tool with the
Code:
~/Downloads/Flashtool/FlashTool
this error shows up
Minimum libusb version is 1.0.14. Found 1.0.9
It can be downloaded on
i have tried everything and i really cannot updated :crying::crying:
Please help me i never done it before
Java 1.6 or 1.7
Hi!
Whenever I try to run the commands, I get the following error message:
"Java version must be 1.6 or 1.7"
I have the latest version of Java installed on my Mac, and I can actually see the Java icon from the Control Panel. Any ideas about the error I get?
Thanks!
Hi!
Whenever I try to run the commands, I get the following error message:
"Java version must be 1.6 or 1.7"
I have the latest version of Java installed on my Mac, and I can actually see the Java icon from the Control Panel. Any ideas about the error I get?
Thanks!
Click to expand...
Click to collapse
1// What version of Mac OS X are you running on?
2// What do you get when you run java -version in terminal?
Hi guys,
thank you so much for this guide,
I have a problem when i try to open flash tool with the
Code:
~/Downloads/Flashtool/FlashTool
this error shows up
Minimum libusb version is 1.0.14. Found 1.0.9
It can be downloaded on
i have tried everything and i really cannot updated
Please help me i never done it before
Click to expand...
Click to collapse
I'm looking into it...
btw are you trying to run flashtool version v0.9.9.0 or an older one?
I written the tutorial a while ago lol

Guide to fixing a soft brick after editing build.prop

I've noticed several users having trouble with their phone when editing the build.prop. They will edit the file, reboot, anxious to use Google Wallet, and be greeted with a black screen of death. Their heart will jump in their throat and they think... "Oh no... I didn't nandroid backup... What's a nandroid backup anyway?" No worries! I have the solution for all of you. Hopefully this short guide will get you going again.
I'm going to run through a quick setup of the Android SDK so that you can use adb if you choose to go this route. The SDK will be useful all though rooted phone usage, so I suggest you download it and use it. ADB is a very powerful tool. First, Google Android SDK. The first result should be the official site for the Google developer section. Just open that top link and the page should have a huge button that says "Download the SDK for (Windows or Mac or whatever)". Click it. Mac users.. Yours does not actually setup. You need to find the SDK Manager app within that zipped download and run it. Windows users... Run the setup. When it's done it will open the SDK manager. Both Users... Check the box next to the "Android SDK Platform-tools". Bottom Right, Install x Packages. Make sure you take note of the SDK path displayed at the top of the manager. EG. C:\Users\Josh\AppData\Local\Android\android-sdk. Mac users: Yours will be in the downloaded folder that you extracted. All Users: Navigate to that folder via terminal (mac) or cmd.exe (windows). Windows: cd C:\Users\Josh\AppData\Local\Android\android-sdk ... Mac: cd /Users/josh/Downloads/android-sdk/ ... Then navigate to the platform-tools folder that is within the SDK folder. Here is where ADB is located.
You also need the naked ADB drivers if you're a Windows user... Here http://forum.xda-developers.com/showthread.php?t=1379875
Once you reboot your phone into recovery: Open start menu, right click on Computer, click properties. This will open the system panel. Top left, click device manager. Somewhere along there, see if you see your device name (something like "Samsung-SGH_I747") with an exclamation point or question mark. Double click it if it does. Click update driver in the window that opened. Click "Browse My Computer...." "Let me pick..." "All devices / next"... "Browse". Now go find where you downloaded and extracted the naked driver zip. Open the folder and double click on one of the available .ini files. You'll get some compatibility warnings, just continue.
Windows instructions:
Download adb.exe, either through the Android SDK or elsewhere. Use Google.
Connect phone to computer via USB.
Boot phone into recovery.
Use cmd.exe (Use Windows key+R, and type cmd in the run window) to navigate to the folder containing adb.
E.g. "cd c:\Users\Josh\Downloads\adb"
Run "adb shell"
This should initiate a shell to the phone allowing you to run commands on the phone. If you get an error, make sure you have the drivers loaded for your phone.
Run "cd /system"
Run "chmod 644 build.prop"
Optional: Run "ls -l" and make sure that the permissions on build.prop show RW-R--R--.
Reboot phone.
Mac Instructions:
Download the adb application, either through the Android SDK or elsewhere. Use Google. Make sure you download the Mac version, not the Windows or Linux version.
Connect phone to Mac.
Reboot phone into recovery.
Open Terminal on Mac. /Applications/Utilities/Terminal.app or use spotlight to find it.
Navigate to folder containing the adb app. E.g. "cd /Users/josh/Downloads/adb/"
Run "adb shell"
This should initiate a shell to the phone allowing you to run commands on the phone.
Run "cd /system"
Run "chmod 644 build.prop"
Optional: Run "ls -l" and make sure that the permissions on build.prop show RW-R--R--.
Reboot phone.
Thanks, worked like a charm on my SII. And I finally have ADB set up for any future hiccups!
ibanezbass said:
I've noticed several users having trouble with their phone when editing the build.prop. They will edit the file, reboot, anxious to use Google Wallet, and be greeted with a black screen of death. Their heart will jump in their throat and they think... "Oh no... I didn't nandroid backup... What's a nandroid backup anyway?" No worries! I have the solution for all of you. Hopefully this short guide will get you going again.
I'm going to run through a quick setup of the Android SDK so that you can use adb if you choose to go this route. The SDK will be useful all though rooted phone usage, so I suggest you download it and use it. ADB is a very powerful tool. First, Google Android SDK. The first result should be the official site for the Google developer section. Just open that top link and the page should have a huge button that says "Download the SDK for (Windows or Mac or whatever)". Click it. Mac users.. Yours does not actually setup. You need to find the SDK Manager app within that zipped download and run it. Windows users... Run the setup. When it's done it will open the SDK manager. Both Users... Check the box next to the "Android SDK Platform-tools". Bottom Right, Install x Packages. Make sure you take note of the SDK path displayed at the top of the manager. EG. C:\Users\Josh\AppData\Local\Android\android-sdk. Mac users: Yours will be in the downloaded folder that you extracted. All Users: Navigate to that folder via terminal (mac) or cmd.exe (windows). Windows: cd C:\Users\Josh\AppData\Local\Android\android-sdk ... Mac: cd /Users/josh/Downloads/android-sdk/ ... Then navigate to the platform-tools folder that is within the SDK folder. Here is where ADB is located.
You also need the naked ADB drivers if you're a Windows user... Here http://forum.xda-developers.com/showthread.php?t=1379875
Once you reboot your phone into recovery: Open start menu, right click on Computer, click properties. This will open the system panel. Top left, click device manager. Somewhere along there, see if you see your device name (something like "Samsung-SGH_I747") with an exclamation point or question mark. Double click it if it does. Click update driver in the window that opened. Click "Browse My Computer...." "Let me pick..." "All devices / next"... "Browse". Now go find where you downloaded and extracted the naked driver zip. Open the folder and double click on one of the available .ini files. You'll get some compatibility warnings, just continue.
Windows instructions:
Download adb.exe, either through the Android SDK or elsewhere. Use Google.
Connect phone to computer via USB.
Boot phone into recovery.
Use cmd.exe (Use Windows key+R, and type cmd in the run window) to navigate to the folder containing adb.
E.g. "cd c:\Users\Josh\Downloads\adb"
Run "adb shell"
This should initiate a shell to the phone allowing you to run commands on the phone. If you get an error, make sure you have the drivers loaded for your phone.
Run "cd /system"
Run "chmod 644 build.prop"
Optional: Run "ls -l" and make sure that the permissions on build.prop show RW-R--R--.
Reboot phone.
Mac Instructions:
Download the adb application, either through the Android SDK or elsewhere. Use Google. Make sure you download the Mac version, not the Windows or Linux version.
Connect phone to Mac.
Reboot phone into recovery.
Open Terminal on Mac. /Applications/Utilities/Terminal.app or use spotlight to find it.
Navigate to folder containing the adb app. E.g. "cd /Users/josh/Downloads/adb/"
Run "adb shell"
This should initiate a shell to the phone allowing you to run commands on the phone.
Run "cd /system"
Run "chmod 644 build.prop"
Optional: Run "ls -l" and make sure that the permissions on build.prop show RW-R--R--.
Reboot phone.
Click to expand...
Click to collapse
I'm having the same issue; I did the above procedures (using a Mac) but every time I type "adb shell", I get this:
"-bash: adb: command not found"
Help, please....
Thanks!
Nevermind, I figured it out.
good write up, thank you
Seems to be only when you use a gnex as build prop.
HTC jewel works great
I had two softbricks worked great
Sent from my SAMSUNG-SGH-I747 using xda premium
very helpful. Thanks!
This doesn't do anything for me. It still shows rw-rw-rw after running that command in adb. Any other ideas?
It also seems like it doesn't modify any of the files at all. I even tried renaming because i have a build.prop.bak file that i want to use and it doesn't seem to rename it.
[update] I am using the Odin method just to reflash it to the stock rom. I have moved on from this useless method.
Hi i just edited the /system/build.prop
for able to play gameloft games
now my tablet cant boot
i use this room : http://forum.xda-developers.com/show....php?t=1816795
i tried your method
i got this error
>adb shell
error: device not found
what can i do i don't want lose data
i tried to recovery mode and normal booted mode no lucks
please help. ican't find my device in device manager
Thank You !!!!!!!
Thank You, Thank You, Thank You, Thank You, Thank You, Thank You - I was hours away from taking my phone back ... I found my build.prop file with 0 bytes but fortunately I already had a build.prop.bak in there. I'm fairly certain I softbricked my phone by not following the instructions closely on rahpyqui utube Google Wallet process. Thanks SO MUCH!
isn't just easier to re-install the ROM you are running? You don't loose any settings.
unable to chmod build.prop
Help me!!
Error: unable to chmod build.prop: Operation not permitted
lyrictenor1 said:
Nevermind, I figured it out.
Click to expand...
Click to collapse
I'm having the same problem, how did you solve it?
IMEI unknown - invalid
I have problem with IMEI ,no sim cards work in lenovo A660.I have done some factory resets and tried all possible solutions referred in xda forums but none worked.DOu think that build.prop could cuz problem to the IMEI somehow? i had to overwrite a build.prop file from a friendly site because i couldnt use 160 characters in sms and they said that this would help.BUt now , no IMEI.Can anyone help?
Thank you for the info:highfive::highfive:
Help!!!
How do I boot my Xperia S into Recovery Mode? Do I have to press the power button + VOL UP Button so that the LED gets blue?
Anyways I did it that way, expecting it to be in Recovery Mode, but when I run the adb shell it says "Device not found." Can somebody help?:crying::crying::crying:
I guess its because I didnt install the naked drivers but I cant do it because I wont find my device in the device manager... Why not?
Very nice guide, thanks!!!:victory:
THANK YOU!
permission denied
I am getting this when starting adb shell
- exec '/system/bin/sh' failed: Permission denied (13)
is this just a driver issue as I installed the naked driver and rebooted after.

Categories

Resources