[Q] Cyanogenmod 7 and Linux - Defy General

Hi all,
I have just received my Defy and I'd like to flash Cyanogenmod 7, I've flashed numerous roms to numerous phones in the past but I was always using Windows. I now use Linux (latest ubuntu derivative).
Is there a guide anywhere for flashing from a linux machine? My google-fu is pretty much pulling up a blank on the subject!
Thanks very much

Follow steps from FAQ for CM7, and just use this : http://forum.xda-developers.com/showthread.php?t=1076138 for flashing SBF and rooting,
It's my second post for the same question today

There's just two things to know:
1) You don't use RSD Lite to flash sbf files, you use this instead: http://blog.opticaldelusion.org/2011/02/sbfflash-updates.html
2) To root the phone you don't use SuperOneClick. Instead, get this DefyRoot pack: http://forum.xda-developers.com/showthread.php?t=1076138. Extract the pack, run the script using sudo.
And that's that. With the above differences in mind, you can follow the usual instructions: http://forum.xda-developers.com/showthread.php?t=1065798
Edit: Damn, bikerabhinav was faster

Thank you guys for the quick replies! time to give it a go
Sorry but you don't happen to know the link for installing adb on linux do you? presumably I need it hehe

I got the SDK and extracted to a directory of my choice, how on earth do I use it though, executing android in a terminal does not work, the rest is simple, can't believe I'm stuck on this part lol
I sorted that, I ran android and downloaded the development tools, I now have adb. I need to research more now, ran adb via terminal, then tried to run the rootdefy.sh but it told me adb wasn't started! see this is going to be a learning curve in Linux

You don't need the SDK, the RootDefy pack has everything necessary. I never installed the SDK.
ADB starts automatically if it isn't running yet. Did you run the script as sudo, like I told you? If not, there can be various problems. It's not necessary to run it with sudo if there's an udev rule for the phone. The script attempts to write one, but I'm not sure if it still works with the latest udev versions.
So let's do it manually:
- unplug the phone
- create a /etc/udev/rules.d/51-android.rules file containing this:
Code:
ATTRS{idVendor}=="22b8", MODE="0666"
- now reload udev:
Code:
sudo udevadm control --reload-rules
- just to be sure, kill all previous adb instances:
Code:
sudo pkill adb
- now plug the phone in and run the script again; with or without sudo, it shouldn't make a difference anymore

Thanks very much, all done and dusted now

Related

[Q] rooting slide in ubuntu

Hey If anyone can help i have a few questions about rooting the slide in ubuntu
the "loop" script will not run regardless of what i do....also i can't seem to get the phone to show up with adb devices when i am in the bootloader
i can see the phone when it is in the rom but for some reason it won't show in the bootloader
thanks in advance
just type
Code:
adb devices
in terminal, and then when you select recovery and press enter, press "ENTER, UP, ENTER, UP, ENTER, UP...) really fast...and hope it works! if not lather, rinse, repeat...
There are instructions in the rooting thread on making an equivalent script for MacOS (which should work under Linux as well.) If you tried to run a DOS batch file under Linux thinking it would work...well, that's a judgment for another day
-------------------------------------
Sent via the XDA Tapatalk App
The Mac script does not run as a sh script on linux.
(PS: don't for the ./ before adb on a linux term. (./adb etc...))
beartard said:
There are instructions in the rooting thread on making an equivalent script for MacOS (which should work under Linux as well.) If you tried to run a DOS batch file under Linux thinking it would work...well, that's a judgment for another day
-------------------------------------
Sent via the XDA Tapatalk App
Click to expand...
Click to collapse
Sent from my T-Mobile myTouch 3G Slide using Tapatalk
Ive got a loop script for linux that I can send you when I get home. And like Indikut said, don't forget to add "./" before adb.
chrisinaz said:
Ive got a loop script for linux that I can send you when I get home. And like Indikut said, don't forget to add "./" before adb.
Click to expand...
Click to collapse
No need for the ./ if you added the sdk tools folder to your PATH.
Why that MacOS script doesn't work in bash on Ubuntu is beyond me. It looks to be formatted correctly.
Code:
#!/bin/sh
while [ 1 ]; do
adb devices;
sleep .25;
done
You could always use the following equivalent:
Code:
#!/bin/sh
watch -n .25 adb devices;
done
Assuming adb is in your path, this would run it every 1/4 second. You could, of course, change it to suit your location for adb (/usr/local/bin/adb or other location).
Cool thanks ..I will try that for the loop script
The other issue I have is that I can't see my phone as a device when I type adb devices in the bootloader ...it works fine when the phone is in the rom tho....I tried searching for the problem but I can't seem to find a solution ....I may just have overlooked it tho
beartard said:
Why that MacOS script doesn't work in bash on Ubuntu is beyond me. It looks to be formatted correctly.
Code:
#!/bin/sh
while [ 1 ]; do
adb devices;
sleep .25;
done
You could always use the following equivalent:
Code:
#!/bin/sh
watch -n .25 adb devices;
done
Assuming adb is in your path, this would run it every 1/4 second. You could, of course, change it to suit your location for adb (/usr/local/bin/adb or other location).
Click to expand...
Click to collapse
thanks again for the help with my problem i have a feeling the macos script would of worked i was using the wrong command i ended up typing "sh loop.sh" and it ran the script ....alltho i don't see it spamming adb devices ...it seems to just output it one time ....
now all i have to do is get the phone to show up when its in the bootloader....off to the search button i go
newspeak said:
thanks again for the help with my problem i have a feeling the macos script would of worked i was using the wrong command i ended up typing "sh loop.sh" and it ran the script ....alltho i don't see it spamming adb devices ...it seems to just output it one time ....
now all i have to do is get the phone to show up when its in the bootloader....off to the search button i go
Click to expand...
Click to collapse
As soon as you hit power to go to recovery either A) Activate the stupid script or B) mash ENTER+UP+ENTER+UP+ENTER until your keys fall off. I only got it to work the latter way.
Also, in Linux I've found that you'll get ???????? NO PERMISSIONS unless you do sudo ./adb devices.
The first time you run adb in a session, it should be started with sudo, since that starts the adb daemon. After that, any normal user's permissions (like running the script) should be ok. Make it easy on yourself and copy the adb executable to some place in your path (I use /usr/local/bin/). That way, you can delete the entire SDK unless you have plans for developing apps for Android.
I tried using my second code snippet above as loop.sh. I didn't go any higher, but it really doesn't have to work really quickly. I went up to .5 (executing "adb devices" twice a second) and it worked fine. You won't see a scrolling output like you would in DOS. The screen just updates if/when new info comes up (like showing the phone offline or in recovery.) When you get to the phone icon with the red triangle, hit VolUp and Power at the same time to get the recovery menu. The rest of the normal root tutorial should work for you.
ok thanks again for the help so far....here is where i am at ...i put adb in /usr/local/bin ...i can use adb devices ....the script is working for me but now when i get to the point where i push over the first file it says permission denied
i make sure to start adb with sudo ....i even tried running everything from a root terminal but i still get the same thing....i have already tried killing the adb server and restarting it with root permissions ...i have tried pushing the file with devices still listed as offline
kind of at a loss
here is what i get btw
"[email protected]:~/androidsdk/tools$ adb push ota.zip /sdcard/update.zip
failed to copy 'ota.zip' to '/sdcard/update.zip': Permission denied
[email protected]:~/androidsdk/tools$
"
I'm using a pretty fresh install of Ubuntu Lucid. I haven't messed with my user's groups or anything, so it's still fairly stock.
All I've done is copied adb to /usr/local/bin. The first run of adb (adb devices) is done as root using sudo. You could try running "sudo adb root" to begin with, and see if that makes a difference. After that, I can run any adb push commands as the normal user in GNOME's terminal.
Assuming you're set up like I am, if you're getting a permissions error after doing that, I'd hazard a guess and say the problem is on the phone's side rather than the computer.
Check and make sure USB debugging is checked in your settings. Beyond that, I'm stumped.

Having Trouble with Mac's for FFF or TWRP or ROOT? Here's some help!

For anyone having an issue with installing TWRP and FFF on a mac here's my two cents on how to help.
I am in no way responsible if you mess something up, you are voiding your warranty, ninja's will attack you, and some other **** about how I'm not liable if you mess up your device.
NONE OF THIS IS MY WORK, ALL CREDIT IS TO JCASE.
THIS IS WHAT WORKED FOR ME ON MY MAC, IT MIGHT NOT WORK FOR YOU, I CLAIM NO RESPONSIBILITY IF IT DOESN'T WORK FOR YOU.
Now,
Make sure you have the sdk, as well as platform-tools downloaded. If you don't know how to do this, go into your sdk, and read the files in there, it will tell you how to download platform-tools.
Once you've downloaded these things, you're going to need the correct fastboot.exe for macs (rename this fastboot.exe, will probably come as fastboot-mac.exe), I don't remember where I downloaded it, nor do i want to break any rules or piss any people off by posting where, but find the correct mac fastboot.exe through google or some other means.
Once you've done all of this, here's what you need to do.
THIS IS NOT MY WORK, I TAKE NO CREDIT FOR IT, IT IS ALL JCASE'S WORK, NONE OF MINE. ALL I AM DOING IS ADDING HOW TO GET TO ADB, FOLLOWED BY THE FEW THINGS YOU NEED TO ADD BECAUSE IT'S A MAC VS. LINUX.
Go to JCASE's thread on rootzwiki, or here, and it will give you the guide. It's his guide, not mine, just add the things I mentioned and it might work. It did for me.
FOR ROOTING:
now you need to first navigate to your platform-tools folder in your android sdk folder using terminal.
Go to utilities in the applications tab in finder. Open up Terminal.
Now type the following line to navigate to the platform-tools folder.
cd ~/androidsdk/platform-tools
for me it is this because my SDK folder is named "androidsdk", if your's is named differently, insert it's name where androidsdk is.
followed by that you can start using ADB. Instead of running things as
adb root, or adb reboot, you need to include
./ before the commands, IE: ./adb root, or ./adb push
IE THE FIRST STEP IS "adb root", rewrite this is "./adb root"
from then on, include that ./ before any command.
____________________________________________________
FOR FFF AND TWRP:
THIS STUFF IS ALL THE WORK OF THE AUTHORS OF THE POSTS AS WELL AS THOSE WHO DID TWRP AND FFF, NOT MY WORK, I'M SIMPLY ADDING WHAT WAS REQUIRED FOR THE GUIDE TO WORK ON MY MAC.
Go to the thread for FFF and TWRP for Linux.
Start off the same by navigating to the platform-tools folder as stated above.
Now when using the SUDO command in the guides for linux for installing FFF or TWRP you will write the commands as:
"sudo ./fastboot" followed by the rest of the command.
INSTEAD of "sudo fastboot"
_____________________________________________________
I honestly have NO idea why I had to do everything this way, from what I remember it has to do with directories or something, but either way it's what fixed everything for me.
Don't consider this a guide or anything I simply added what I was missing for the linux guide to work on my mac, as I don't want to be someone who people blame if it didn't work for them, as I'm simply doing what works for me. AND in the end, this is all Jcases work, and those who wrote the guide for TWRP and FFF linux installs.
I hope this helps the other mac users that I'm sure are here and are struggling, cause I had to remember how to do all this stuff before I realized why I was ****ing up doing all this stuff.
Good luck!
Or just use this: KindleWater

Xperia on Ubuntu (Udev rules, Flashtool, ADB&Fastboot)

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?

[GUIDE] ADB & Fastboot not working under Windows? UBUNTU WILL DO!

The keystone of this guide: make ADB & fastboot working in Ubuntu, when nothing else helps with with Windows. Resent Windows OS versions are getting less flashing-friendly and some brands (like Samsung) release new devices on the market without compatible USB drivers. Before losing countless hours trying to solve the problems, try this, possibly very easy solution.
Compatible devices: ADB will work on nearly all devices, fastboot should be also usable for very most of the devices with bootloader mode: Nexus, HTC, Sony etc.
The guide is posted here in Nexus 7 (2013) thread for high amount of reported bootloops right after unlocking the bootloader- or problems with executing fastboot commands in Windows, which must work to unbrick the device.
DISCLAIMER:
Code:
* [I]I am not responsible for bricked devices or PCs, personal crisis, depressions[/I]
* [I]sleeples nights, termonuclear wars, electricity blackouts, short circuits,[/I]
* [I]or for bad weather in your region that will brick your Android device or your PC.[/I]
* [I]I try to help here, but it may not work for you. You do all on your own risk.[/I]
Click to expand...
Click to collapse
INSTALL ONLY FASTBOOT :
Windows can cause so many problems, that sometimes ADB & Fastboot simply won't work.
Run therefore ADB or fastboot in Ubuntu if Windows fails.
Installing ONLY fastboot in Ubuntu (should work with 10.x, 11.x and 12.x)
(internet connection required)
Run in the Terminal:
Code:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
Reboot isn't required.
Save all the flashing files on home folder, or navigate with "cd" to your files.
Happy flashing!
For the case it doesn't work after this, try THIS method which is little bit more complicated, but should work in actually all Linux OS variants.
Click to expand...
Click to collapse
INSTALL ADB AND FASTBOOT :
To fix a bootloop, for unbricking, to root, to unlock/relock the bootloader, for flashing of a stock firmware, kernel, or recovery: for all those things fastboot must work reliably. And in Windows, it sometimes simply won't work at all, whatever you try.
Windows OS is complicated. And needs drivers at all times. Successful use of ADB or Fastboot with Windows is totally dependent on perfectly installed drivers. And there we have the source of many problems. As way around all those in fact Windows related promblems, we will use here Linux instead of Windows. Linux needs no drivers. Linux is free. Linux needs no antivirus software. Linux gets optimized day by day. Your Android device is Linux based.
After reading how many users encounter day by day countless issues by attempt to run fastboot and ADB commands (especially here in Nexus threads), I've decided to make this guide. There are some longer and complicated guides here around. I like fast, easy and secure way- so I hope this will help.
STEP 1: how to run Linux on Windows PC
There are many variants of Linux OS, but to keep the things really simple I will refer here entirely to the most popular variant of Linux: Ubuntu.
Windows users have three common ways to run Ubuntu on their Windows PC:
OPTION 1: installing Ubuntu permanently (my personal preference)
Pros: you will gain Ubuntu OS besides Windows and possibility for dual-boot. Reboot between Windows and Ubuntu takes about 1 minute. Full functionality of both operating systems.
Cons: in very seldom cases the installation of Ubuntu doesn't work flawless and if Ubuntu gets installed on the same HDD, Windows OS can get partly damaged or unusable, or has to be re-installed. Part of HDD memory space has to be permanently reserved for Ubuntu (min. 10GB recommended) and won't be accessible from Windows anymore.
OPTION 2: running Ubuntu from bootable live-CD
Pros: Ubuntu won't get physically installed, it runs 100% virtually from bootable live-CD and uses only RAM of the PC. People who don't desire to install Ubuntu permanently will have no changes on their PSs. No potential risks due to unsuccessful installation. In general, works with most of the computers.
Cons: No data or settings can get permanently saved in Ubuntu, especially Linux novices will have to learn quickly about setting the permissions: each time again after restarting Ubuntu session from the live-CD. Ubuntu is considerably slower this way.
OPTION 3: running Ubuntu from VirtualBox (in your Windows OS)
Pros: easy way to run Ubuntu directly from Windows in kind of "sandbox"
Cons: doesn't work well with some PCs
STEP 2: INSTALLING FASTBOOT & ADB IN UBUNTU
Now when your Linux OS is working, we can finally go for it!
Make sure to have internet connection
open the Software Center in Ubuntu
install openjdk-7-jdk
install Eclipse
download adt-bundle for your respective OS (32-bit or 64-bit version) from http://developer.android.com/sdk/index.html
extract the folder and paste the extracted folder to prefered folder and rename it to your prefered folder name
run the Terminal and navigate (cd) to the unzipped folder into "platform-tools"
Example for novices: I have pasted my extracted adt-bundle folder under "Home" and renamed it to "SDK", so I have to navigate to my platform-tools this way:
Code:
cd /home/tetakpatak/SDK/sdk/platform-tools
After this, you should be able to execute all the ADB and fastboot commands
Now just mind to paste all the files you desire to flash or push or sideload into your "platform-tools" folder!
Happy flashing!
Click to expand...
Click to collapse
DOWNLOAD LINKS
Ubuntu OS: DOWNLOAD HERE
Virtual Box: DOWNLOAD HERE
Warning: VirtualBox supports only the 32-bit version of Ubuntu, so also owners of 64-bit PC-systems should make sure to download the 32-bit version of Ubuntu, and not the 64-bit version!
ADDITIONAL INFORMATION AND USEFUL LINKS
Checklist for ADB:
for using in Android OS make sure to enable USB debugging under "developer options"
ADB works in Android OS and in the recovery mode, but not in the bootloader mode
make always sure at the very beginning that your ADB connection works by typing "adb devices" (the response must include a serial number on the left and "device" right after it!)
Basics about ADB: check for example this excellent ADB guide
Checklist for fastboot:
fastboot commands can be executed only in bootloader mode
fastboot commands will work also if USB debugging was disabled
make always sure at the very beginning that your fastboot connection works by typing "fastboot devices" (the response must include a serial number on the left and "fastboot" right after it!)
by using fastboot for the first time on a PC or Android device, never start with bootloader flashing! Missmatched bootloader flashing can hard-brick the device. Rather first execute "fastboot reboot-bootloader" and try to flash a kernel or recovery to make sure flashing commands are working and the connection is established.
Flashing with fastboot (example Nexus 7 v2012): check this excellent guide by @comminus
My self made video of flashing a full factory image with manually done fastboot commands in real time (example Nexus 7 v2012):
Click to expand...
Click to collapse
Please use "thanks" button beyond my posts if you find this guide useful. I've spent my time to help you, who read this.
TROUBLESHOOTING:
Occasionally, the device's storage doesn't get recognized in Ubuntu (something like MTP Camera error, can't mount camera, or so). The source of this problem is, that Ubuntu 12.04 doesn't support MTP natively yet, hopefully 13.04 will do.
This is the solution that should work with Ubuntu 12.04, enter in Ubuntu Terminal following:
Code:
sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get install gvfs
restart your PC, now everything should work (enable USB debugging if it doesn't)
If this method wasn't successful, you can try alternatively to do the same thing with these two repos:
Code:
sudo add-apt-repository ppa:webupd8team/unstable
sudo apt-get update
sudo apt-get install go-mtpfs
After the last command just reboot the PC
Also this repo could work:
Code:
sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get dist-upgrade
If none of both repos works and you want to uninstall both of them, just enter:
Code:
sudo ppa-purge ppa:webupd8team/unstable
sudo ppa-purge ppa:langdalepl/gvfs-mtp
great tutorial!
tetakpatak said:
reserved
Click to expand...
Click to collapse
Hey brother, great tutorial...
I know this will help so many people in the future and i love to see anything linux based! I have been using linux/bsd based operating systems for years and i love the way linux and android work together!
Take care my friend and thanks again for all of the hard work.
-droidshadow
You can also put your computer in test mode which bypasses msm kernel mode code signing policy. This will enable the ability to install the drivers needed. From the administration profile on your PC open a command prompt and type
Bcdedit.exe -set TESTSIGNING ON
Then restart your computer.
Edit: This is for Windows 7 X64 and Windows 8 users alike.
Sent from my Nexus 7 Flo running CM 11 4.4.2 with ElementalX Kernel using XDA Premium 4 mobile app
I keep getting a keyserver error when entering first command.
Got it to install the problem I see now is with java
Steve One said:
I keep getting a keyserver error when entering first command.
Click to expand...
Click to collapse
Which Linux version do you use?
tetakpatalked from Nexus 7 flo
tetakpatak said:
Which Linux version do you use?
tetakpatalked from Nexus 7 flo
Click to expand...
Click to collapse
Mint15
Here's another shot
Steve One said:
Here's another shot
Click to expand...
Click to collapse
Please google a bit, I think you need another repo for Mint 15, I think I saw it somewhere in www last week. Sorry, I can't research right now until end of week.
tetakpatalked from P5110
tetakpatak said:
Please google a bit, I think you need another repo for Mint 15, I think I saw it somewhere in www last week. Sorry, I can't research right now until end of week.
tetakpatalked from P5110
Click to expand...
Click to collapse
I'm truly stumped went from Windows Vista to all Linux to be able to use adb and still can't get it to recognize my device.
I installed the java 7 sdk but it still doesn't recognize my device..........guess I will try to get a Petra CD don't know what else to do ha ha and I thought this was the easy way to get adb to work. Thank you for your help kind Sir.
Steve One said:
I'm truly stumped went from Windows Vista to all Linux to be able to use adb and still can't get it to recognize my device.
I installed the java 7 sdk but it still doesn't recognize my device..........guess I will try to get a Petra CD don't know what else to do ha ha and I thought this was the easy way to get adb to work. Thank you for your help kind Sir.
Click to expand...
Click to collapse
It should definitely work with Ubuntu versions 10. 11. and 12.04 even without extra installing Java. I didn't try it with other Linux versions.
Which Linux did you install? Did you enable USB debugging?
Check in www as there are different repos available for ADB and fastboot.
Opening post updated: added procedure for enabling all ADB and fastboot functions in Ubuntu, for the short way with enabling fastboot only doesn't work with every Ubuntu version.
tetakpatalked from the legendary i9000

Question How to install factory image using Linux

Hey guys,
I was trying to update while keeping root and made a mistake. i don't think my phone is hard bricked, as it does boot, it just never actually reaches the stock
When device boots, it says "device is corrupt, it can't be trusted and may not work properly". This happened after I tried to utilize the Master-Root.img file. Not sure exactly how this happened, I will investigate later, but right now trying to get something on my phone (right now it just doesn't boot past the error message I just mentioned)
I looked online, and I've heard methods about using a flash-all.bat and flash-all.sh file within the factory image. However, I'm using linux, not windows, these files so not seem to work.
for the record:
bootloader is unlocked
phone was rooted prior to this happening
i don't deny i made some kind of mistake that resulted in this happening, i just don't know what yet. i will investigate, but right now just trying to recover my phone. there does not appear to be an OS on it, or it is corruped
i will post any images that are needed, im just under a time constraint
i have the factory image on my computer already. what do i need to do to get this installed? i looked up tons of guide, but it only seems to be applicable for windows.
thanks so much in return btw!
You can use Android Flash Tool. Flash-all.sh should work on LInux as well. But Android Flash Tool is probably the easiest way.
Lughnasadh said:
You can use Android Flash Tool. Flash-all.sh should work on LInux as well. But Android Flash Tool is probably the easiest way.
Click to expand...
Click to collapse
is Android Flash Tool a windows only program? or does this work on Linux too? because linux is all i have at the moment.
pojr said:
is Android Flash Tool a windows only program? or does this work on Linux too? because linux is all i have at the moment.
Click to expand...
Click to collapse
Yes, supports Linux.
Android Flash Tool | Android Open Source Project
source.android.com
Lughnasadh said:
Yes, supports Linux.
Android Flash Tool | Android Open Source Project
source.android.com
Click to expand...
Click to collapse
Thanks so much. I will try this out. For the record, I actually did go into flash-all.bat and I noticed the individual terminal commands it wanted me to put in. So I tried putting them in manually, but after I finished the commands and rebooted the phone, I still received the same message "device is corrupted, it can't be trusted".
I will still try the tool that you linked though, but I'm nervous it won't help because I tried running the commands individually that were within the flash-all file.
Later on I will go into more detail on what I mean, but I'm at work right now and I don't have a lot of time to type.
pojr said:
I looked online, and I've heard methods about using a flash-all.bat and flash-all.sh file within the factory image. However, I'm using linux, not windows, these files so not seem to work.
Click to expand...
Click to collapse
I'm on linux (fedora) and the flash-all.sh script will work, but you have to ensure adb and fastboot drivers are installed system-wide or you run your terminal from platform-tools. If you want to be able to run the script from any directory, you'll have to edit your bash config to point to the directory of your platform-tools. You may also need to edit your udev rules.
Bash
sudo nano .bashrc
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
udev Rules
See github page for instructions, assuming your distro requires it.
Linux Fix Fastboot "no permissions, verify udev rules"
Linux Fix Fastboot "no permissions, verify udev rules" - fbootfix.md
gist.github.com
Edit: If you're on any distro with an up-to-date version of android-tools, you can install the package and it will automatically install the adb/fastboot drivers system-wide and you can skip the above manual process. Otherwise, if android-tools is too old, fastboot won't work and the shell script will end abruptly as it's out-of-date compared to the most recent A12 or A13 builds.
pojr said:
Thanks so much. I will try this out. For the record, I actually did go into flash-all.bat and I noticed the individual terminal commands it wanted me to put in. So I tried putting them in manually, but after I finished the commands and rebooted the phone, I still received the same message "device is corrupted, it can't be trusted".
I will still try the tool that you linked though, but I'm nervous it won't help because I tried running the commands individually that were within the flash-all file.
Later on I will go into more detail on what I mean, but I'm at work right now and I don't have a lot of time to type.
Click to expand...
Click to collapse
One method to get rid of the corrupt message that has worked for people is to flash the boot image from the prior month in fastboot (it will likely not boot) and then flash your current boot image.
Lughnasadh said:
One method to get rid of the corrupt message that has worked for people is to flash the boot image from the prior month in fastboot (it will likely not boot) and then flash your current boot image.
Click to expand...
Click to collapse
I will try that as a last resort (if all else fails)
To go into more detail, when I opened up terminal, I migrated to the folder that has the flash-all files (both the .bat and .sh) by typing "cd [folder name]", however I didn't know how to run those scripts in terminal, even after googling. So I opened the .bat file in text editor and notice the script had 3 or 4 fastboot commands.
Since I couldn't get flash-all file to run on its own, I tried manually typing in fastboot commands right into the terminal. The first fastboot commands seems to run without any problems, but then the final fastboot command seems to have issues. While it ran, they were a bunch of files it could not find. But still, it didn't give a error or anything. So once the three or four fast food commands were ran, then I rebooted the device, and still received the "device is corrupted, device cannot be trusted" error.
Still haven't downloaded that program you linked to yet, I apologize. I have to wait until lunch to try this because I'm at work. Don't you hate it when you're running to issues right before work? Haha.
pojr said:
To go into more detail, when I opened up terminal, I migrated to the folder that has the flash-all files (both the .bat and .sh) by typing "cd [folder name]", however I didn't know how to run those scripts in terminal, even after googling. So I opened the .bat file in text editor and notice the script had 3 or 4 fastboot commands.
Click to expand...
Click to collapse
Use the batch file (.bat) on windows and use the shell script (.sh) on linux. They both execute the same commands based on the OS.
To run the shell script from terminal, type:
sh flash-all.sh
lottarake said:
Use the batch file (.bat) on windows and use the shell script (.sh) on linux. They both execute the same commands based on the OS.
To run the shell script from terminal, type:
sh flash-all.sh
Click to expand...
Click to collapse
thank you. i just tried this. says "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
not a problem. you did mention i need to install the latest platform tools. so i did, and tried again. same error message, fastboot too old. now i'm on the latest platform-tools, so not sure why i'm receiving that message.
currently installing android flash tool right now. having difficulties because (for some reason) chrome is required. i'm on firefox. but i will update once it's all installed. thanks again for the support btw.
Update: On the android flash tool right now. So far I like what is happening. Didn't realize how easy this is. I am a little concerned though, because while the site appears to be working as intended, my phone is still on the fastboot screen with nothing on it, but that might be normal. I'll keep waiting and see what happens.
pojr said:
thank you. i just tried this. says "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
not a problem. you did mention i need to install the latest platform tools. so i did, and tried again. same error message, fastboot too old. now i'm on the latest platform-tools, so not sure why i'm receiving that message.
currently installing android flash tool right now. having difficulties because (for some reason) chrome is required. i'm on firefox. but i will update once it's all installed. thanks again for the support btw.
Click to expand...
Click to collapse
If the latest adb/fastboot drivers aren't system-wide and you're running the commands from any other directory other than from the platform-tools folder, you'll get the out-of-date error. If you want to run it from the directory, make sure to add "./" (without quotes) before adb/fastboot.
Example:
./adb devices
If you edit your bash config to point to the new platform-tools folder, it'll execute adb/fastboot from the latest you've downloaded as system level versus what was installed on your OS previously.
lottarake said:
If the latest adb/fastboot drivers aren't system-wide and you're running the commands from any other directory other than from the platform-tools folder, you'll get the out-of-date error. If you want to run it from the directory, make sure to add "./" (without quotes) before adb/fastboot.
Example:
./adb devices
If you edit your bash config to point to the new platform-tools folder, it'll execute adb/fastboot from the latest you've downloaded as system level versus what was installed on your OS previously.
Click to expand...
Click to collapse
Thank you. I will look into that.
So at the moment, I'm running the Android flash tool. Seems to be pretty straightforward, but the download keeps starting over. Is that supposed to happen? Or is there something wrong? My apologies if I'm sounding like an idiot right now
pojr said:
Thank you. I will look into that.
So at the moment, I'm running the Android flash tool. Seems to be pretty straightforward, but the download keeps starting over. Is that supposed to happen? Or is there something wrong? My apologies if I'm sounding like an idiot right now
Click to expand...
Click to collapse
Not quite sure the reason it's restarting tbh. It should only download the zip once and then proceed to flash as long as it's properly connected to the phone. When using the Android Flash Tool, I stick to Chrome since it seems to work properly for me. I haven't tested it with Firefox yet. You could always reset the adb access to Firefox by disconnecting the phone and closing the browser, then from terminal run "adb kill-server" before reconnecting and granting adb to Android Flash Tool again.
lottarake said:
Not quite sure the reason it's restarting tbh. It should only download the zip once and then proceed to flash as long as it's properly connected to the phone. When using the Android Flash Tool, I stick to Chrome since it seems to work properly for me. I haven't tested it with Firefox yet. You could always reset the adb access to Firefox by disconnecting the phone and closing the browser, then from terminal run "adb kill-server" before reconnecting and granting adb to Android Flash Tool again.
Click to expand...
Click to collapse
I'm on Chrome now. I think it might just be poor USB connection. I moved it to a safer position, so hopefully that will fix the problem. Seems like it's installing now. I'm having some really bad luck today lol.
Good news. I checked my phone just now, it is now booted without any issues. Thank god. Long story short, I ran into some issues trying to perform an OTA update while keeping root access, but ran into issues while following the directions. So I started troubleshooting the problem and went a little too far with it. Thanks so much @lottarake and @Lughnasadh for helping me out.
Not sure if the OS will remain on there if I reboot the device. I assume so, because the OS was installed, not just flashed.

Categories

Resources