Related
This guide was originally written by ante0 on VillainROM.co.uk. For the original click here. Due to some people having issues accessing VillainROM's website I have asked ante0 to give me permission to post the guide here. He happily obliged so thanks go to ante0 for this guide!
All I have done to it is change the layout and remove any unnecessary text.
Tools needed:
Android SDK
HTC Sync 3.0.5387 - get the latest if this is old
WinRAR - to extract Android's SDK files
Patience and time
1. Getting ADB (Android Debug Bridge)
ADB is a part of android's SDK. It can be obtained here. Please get the latest Windows version.
Next we need to "install" it.
This is done by simply extracting it to your hard drive:
Install WinRar, then right click on the zip file and choose "extract to".
I chose C:\ as the folder in the zip is named "android-sdk-windows", so you can find the files in C:\android-sdk-windows
After that is done we are now done with the "installing" part.
2. Setting up environment variables - access adb from outside of \android-sdk-windows\tools directory in a command prompt
Now that we have extracted all files we need to set up Windows environment variables to make our lives easier.
I always do this, because it saves you having to cd C:\android-sdk-windows\tools every time you load a cmd prompt.
Windows XP:
Right click on "My computer" and select "Properties"
Click on the "Advanced" tab in the box that appears, looks like the pic below.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click on the button named "Environment Variables".
Now, double click on the text entry named "Path" in the lower list box
At the end of it, add ";C:\android-sdk-windows\Tools"
(";" is required at the start so windows knows it's a new entry.)
Click on OK to exit out of the dialog, then OK again to get out of My computer's properties. After you reboot your computer you'll have it set up.
Windows 7/Vista:
Right click on "Computer" and select "Properties"
In the System window that appears click on "Advanced System settings" located in the left list
Click on the Advanced tab in the box that appears, then on the "environment variables" button.
Double click on "Path" located in the lower list box.
At the end of it, add ";C:\android-sdk-windows\Tools"
(";" is required at the start so windows knows it's a new entry.)
Now click on OK, then OK again to exit. Restart and all will be set up.
3. Making sure USB works
(original guide linked to my old driver guide - here are new details)
Install the very latest version of HTC Sync - 3.0.5387 is the latest at time of writing but get the latest if this is old
This should install the correct drivers regardless of whether you're on 64-bit, 32-bit, Vista, 7 or XP.
4. Using ADB
(unedited)
I won't list all commands you can use here. I will only list some examples...
Remember to plug your phone in your usb cable (I've forgotten sometimes... lol)
Start by opening a command prompt.
This is done by opening up the startmenu then click on "Run..." (Alternative way: Windowskey + R).
In the "Run..." box, enter "cmd" without quotes.
If you have some knowledge of using a cmd prompt you don't need to read the next part.
To navigate you mainly use the commands CD and DIR.
Here's an image of what it looks like
C:\Documents and settings\jwork> tells you what your current working folder is.
To get out of it, use the command "cd ..".
This will go back one folder, so your new location will be C:\Documents and settings>
One more "cd .." will take you to C:\.
Now, lets say you have a folder named Images in C:\. To enter it you use "cd Images".
If you want to list all files in that folder, enter the command "dir".
Now you might have a image named image01.jpg in that folder, that you want to get to your phone.
Use the command adb push image01.jpg /sdcard/
It should notify you now if the push was successful.
You can check if the image is on your sdcard by using the command "adb shell ls /sdcard/".
That should conclude this guide...
One more thing, if you just enter "adb" it will show a list of all commands with descriptions.
Any questions? Just post here.
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Sounds like you haven't successfully added adb to your DOS path. Re-read section 2 again and make sure you followed the instructions correctly.
Great guide man, very nice work
That's awesome!!! It's a nice tutorial for the newbies! And it benefits me, I reli like it!!
Thx!!!
Sent from my E15i using XDA App
jubo1236 said:
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Click to expand...
Click to collapse
I had the same problem because the path was incorrect. I found the adb command in
Code:
android-sdk-windows/platform-tools/
rather than in
Code:
android-sdk-windows/tools/
btdag said:
1. Getting ADB (Android Debug Bridge)
ADB is a part of android's SDK. It can be obtained here. Please get the latest Windows version.
Click to expand...
Click to collapse
hi,
thanks for the explanation both for you and ante0 but can you reload the link if possible becaue i cannot download the file for the first step? it gives error
No matter what I do. I always get the "adb" is not recognised as an internal or external command , operable program or batch file. What am I doing wrong?
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
After doing all the above stated i still can't execute any commands. I typed "adb devices" and it just says the devices that are linked but it doesn't give me a serial number.
NeatBee said:
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
Click to expand...
Click to collapse
What does it say? Copy it to here
Sent from my Hero using Tapatalk
I have tried to restart the computer, sign in and out, install SDK again and again, changed the PATH in Enviromentor variables ... but still refuses ADB to work!
I typed "C: \ android-sdk-windows \-platform tools," in the PATH box and restarted the computer. Then I typed "adb" in CMD, but it is all the time: "'adb' Is Not Recognized as an internal or external command,
operable program or batch file. "
Is crazy! What is the problem?
BTW, I have installed the driver for my phone and selected "USB debugging".
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
hello
NeatBee said:
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
Click to expand...
Click to collapse
I think you are using wrong format, \ instead of /
For me I used "C:\Program Files\Android\android-sdk-windows\platform-tools\;C:\android-sdk-windows\tools\;"
in order to make it work"....ignore quotes.
Yet when I try to do the push command with some files
it gives me error: devise not found
anyone have clue?!
Thanks
This guide is rock solid! Thanks
mm realy need to learn to use adb been flashing my hero for over a year now and still dont know how adb works
sorry for the silly question but will the same steps help to setup a path for windows 7
because i really need to know how to use it as well if someone acn post a link for steps to use it it would be really appreaciated
thanks
EDIT: extremely sorry did not read the full post there is already a guide for windows 7
thanks for the post
ok so i have tried all of the above steps
i now get adbd cannot run in production builds
thanks alot
once i get adb all set up and it works fine - can i uninstall HTC sync and HTC driver? will adb still work?
Before we start, ROOT access, along with the "usb debugging" to be enabled on your phone for this unlock to be successful. Your phone must be connected to the computer.
UPDATE:One-click unlock for PC & MAC Created: http://forum.xda-developers.com/showthread.php?t=761751
The first step requires ADB which is a console that comes with the Android SDK, and is located in the C:\ Drive.
You can create a easy script to access adb by creating a text file and copying the following information:
Code:
@echo off
cd c:\android-sdk-windows\Tools
adb devices
pause
adb shell
NOTE: The android sdk must be in the C:\ drive for the script to work, and you can rename the "android-sdk-windows" to something else if you have an alternate name for your android sdk folder.
name the script ADB, and rename the .txt extension to .bat (enable view hidden file extensions in folder options) and run it for quick, and easy access to adb.
Now that problem is solved, lets get on to extracting the actual file from the internal sd card, to your computer for the purpose of extracting the unlock code.
Run adb.bat to open up adb, or any other method you might use and you should see a cmd promt with A list of the devices attached along with your device.
Press any key, and you should see a $ -----> type "su" (without the quotation marks) and press [ENTER]. If your device has already granted "su" or Superuser permissions to your desktop adb console, then you should see a # now you type
the following:
cat /efs/nv_data.bin >> /sdcard/nv_data.bin
press [ENTER] and you should see a repetition of the command you just typed with the difference being that the "#" is not before it, but under it.
You have successfully transferred the file to your internal sd card!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now to transferring the file that we will obtain the unlock code, to the computer to extract said code.
On your phone (while still connected to the computer) you must mount the USB storage to extract the file off the internal SD card, (to do this drag the notification bar down while connected, and click the "usb connected" button, which will prompt a pop up for "Mount" and "Don't Mount", we'll be mounting the sd card to extract the file)
now check "my computer" and look for the storage disk of the internal sd card for your phone (not the external!)
then move the "nv_data.bin" file to your C:\ drive
Now you need to download the "sgux.exe" unlock code finder, you can find it at the following:
http://www.mediafire.com/?js8dgn3nic5asb0 or http://www.multiupload.com/2IAYWWGF8A
after downloading the file from either mirror (the media fire one is zipped, which means you need to extract it) you need to move the sgux.exe file to your C:\
Now onto the last step:Obtaining the Code!
after having both the sgux.exe, and nv_data.bin file in the C:\ drive
Run your command promt (run>cmd or if you have a "windows key" press the windows key+r) in the command prompt type "cd C:\" (without the quotation marks) then sgux.exe nv_data.bin and voila the proccess should generate your own 8-digit unlock code!!
Now give yourself a pat on the back for your hard work ;P
HOW TO LOCK SAMSUNG GALAXY S - FOR WARRANTY AND ALTERNATIVE "UNLOCK"
After you get the NCK code using the method above, enter: *7465625*638*#
There will be a pop-up box.
Complete the first field (MCC/MNC) with the network you want your phone locked to (eg. 226 10 where 226 = romania; 10 = orange etc.) and the second field (Control Key) with the NCK extracted from the .bin file.
Press OK and your phone should relock.
This method can also be used in the case where the universal unlock code doesn't work, this is done by "locking the device to the carrier+sim" so someone who uses Rogers in Canada, would use the NETWORK "MCC" for their Country (302) and MNC for the carrier (720) so you use 302 720 with the instructions above to lock the phone to Rogers in Canada, thus allowing you to use the sim card. This is a "unlock" in terms that you can use it with another carrier, but not a "universal" unlock that can be used with any carrier without the hassle of repeating the above method.
Here are the MCC/MNC country codes:
http://en.wikipedia.org/wiki/Mobile_Network_Code
HOW TO UNLOCK AFTER PLACING DIFFERENT SIM
After inserting new sim, you should be prompted to enter unlock code, if not then to unlock your phone just use the code: #7465625*638*# and enter your NCK in the pop-up box. Press OK. Phone should get unlocked .
Click to expand...
Click to collapse
NOTE: Below I have attached the "adb.bat script, and the sgux.exe" files in zips, for those who want to download it directly from here.
I have flashed to JM5 and with Samset 1.9f, It comes pre-rooted but does not have a terminal emulator yet and Id like to give this a try on my locked Galaxy S, but Im not familiar with how to get ADB for my computer.. maybe you can add the steps or post another link for ADB ?
EarlZ said:
I have flashed to JM5 and with Samset 1.9f, It comes pre-rooted but does not have a terminal emulator yet and Id like to give this a try on my locked Galaxy S, but Im not familiar with how to get ADB for my computer.. maybe you can add the steps or post another link for ADB ?
Click to expand...
Click to collapse
I've included all the instruction for running ADB , but in that case make sure you have the android sdk installed
You can download it at the following:
http://dl.google.com/android/android-sdk_r06-windows.zip
Extract the zip, and then just follow my instructions in my original post.
I've also included a script to run it directly, it's attached in the first post and is called "adb.zip" that has the adb.bat script inside.
UPDATE:
You can also use the original method
http://forum.xda-developers.com/showpost.php?p=7776555&postcount=1
but instead of the adb code in there which is the following:
Code:
adb shell
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
the above is the original method, but for some adb consoles there's a VITAL step missing!
the actual dev directory.
So below is the fix for the first method to work (use this)
Code:
adb shell
cd /dev/block
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
Bowsa2511 said:
UPDATE:
You can also use the original method
http://forum.xda-developers.com/showpost.php?p=7776555&postcount=1
but instead of the adb code in there which is the following:
Code:
adb shell
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
the above is the original method, but for some adb consoles there's a VITAL step missing!
the actual dev directory.
So below is the fix for the first method to work (use this)
Code:
adb shell
cd /dev/block
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
Click to expand...
Click to collapse
the cd /dev/block shouldn't matter but I will add it to the guide
dagentooboy said:
the cd /dev/block shouldn't matter but I will add it to the guide
Click to expand...
Click to collapse
In my case (along with others) it wouldn't recognize and direct to the directory automatically, causing the creation of the nv_data.bin method.
The simple fix was directing adb to that directory XD
Bowsa2511 said:
In my case (along with others) it wouldn't recognize and direct to the directory automatically, causing the creation of the nv_data.bin method.
The simple fix was directing adb to that directory XD
Click to expand...
Click to collapse
ok sounds good. I found the nv_data.bin method by tracing where bml3 was being mounted. It turns out bml3 is mounted at /efs .... that is probably why you need su to copy bml3 because it is in use.
guys, could you please explain how to sim unlock but with some easier methods
these ADB and so on just have eaten my brains
spent 3 hours and 0 result
using mac os + windows 7 as virtual machine
DarkVasyaK said:
guys, could you please explain how to sim unlock but with some easier methods
these ADB and so on just have eaten my brains
spent 3 hours and 0 result
using mac os + windows 7 as virtual machine
Click to expand...
Click to collapse
Check out the original thread here. I updated it with an automatic script to generate the code.
It Worked.............great................Thank you so much.......
thansk for this!
Instructions worked perfectly ... got my code!
Now just have to find a foreign SIM to complete the job ...
Thanks to all that made this possible. AT&T was being a real PITA about unlocking.
Bowsa2511 said:
Before we start, ROOT access, along with the "usb debugging" to be enabled on your phone for this unlock to be successful. Your phone must be connected to the computer.
The first step requires ADB which is a console that comes with the Android SDK, and is located in the C:\ Drive.
You can create a easy script to access adb by creating a text file and copying the following information:
Code:
@echo off
cd c:\android-sdk-windows\Tools
adb devices
pause
adb shell
NOTE: The android sdk must be in the C:\ drive for the script to work, and you can rename the "android-sdk-windows" to something else if you have an alternate name for your android sdk folder.
name the script ADB, and rename the .txt extension to .bat (enable view hidden file extensions in folder options) and run it for quick, and easy access to adb.
Now that problem is solved, lets get on to extracting the actual file from the internal sd card, to your computer for the purpose of extracting the unlock code.
Run adb.bat to open up adb, or any other method you might use and you should see a cmd promt with A list of the devices attached along with your device.
Press any key, and you should see a $ -----> type "su" (without the quotation marks) and press [ENTER]. If your device has already granted "su" or Superuser permissions to your desktop adb console, then you should see a # now you type
the following:
cat /efs/nv_data.bin >> /sdcard/nv_data.bin
press [ENTER] and you should see a repetition of the command you just typed with the difference being that the "#" is not before it, but under it.
NOTE: Below I have attached the "adb.bat script, and the sgux.exe" files in zips, for those who want to download it directly from here.
Click to expand...
Click to collapse
Thank you for your step by step sir, very helpful, as i was trying to figure out how to get ADB running on my PC.
Thanks again.
not working...tried all methods for pc
tried adb method and cannot create nv_data.bin file system is read-only
tried unlocker app and it says NO CODES FOUND, and also says are you sure your using a samsung galaxy S.
my phone is samsung i897 captivate under att contract, never had to enter a code in the past, but now the phone is locked and i cant retrieve the code, any ideas?
Help please
i´ve tried to unlock have searched der nv_data.bin with a root explorer app, copied this to sd and from there in my folder c:\hack, where the sgux.exe is also
I run it and following i see if its ready:
Opening file <nv.bata.bin>....
Searching code block....
Found
Searching Code...
C:\hack>
where is my code?
Please help
Awesome guide! Can't wait to get my phone monday
I tried adb, and when I type su I get a reply superuser denied, don't understand why, need help
bump......
After running sgux.exe nv_data.bin, this is what show up:
MCC/MNC lock :00101
Any idea?
I'm on att, but currently roaming in China...
after I type su, it say's "Permission denied" what am I doing wrong? Can some please help me
I was deleting unused apps from my phone and, like an idiot, I deleted my only installed launcher. The phone boots and I can access the settings. I have a launcher installed and it shows up in menu/ settings/ app but it wont start and I don't know how to start it. I do have adb and fastboot though I don't have wireless internet. This device is not activated and there is no gmail account linked to this device. I did create a zip of a launcher and tried to flash it through recovery but that didn't work. I do not have a custom recovery installed but I did root the device. Is there a way to get a launcher installed and working so I can use this device again?
Grab the APK file for the stock launcher (or any launcher of your choice), connect your phone to the computer via USB with debugging on and install the launcher using this ADB command:
adb install launcher.apk
Make sure to replace launcher.apk with the exact name of the APK file, of course. You might need to copy the launcher to your SDK's platform-tools folder and run this command while in that directory as well, if the folder hasn't already been added to your PATH variable.
Once done, reboot your device. You can then use any root-enabled file manager to simply copy the launcher's APK file into /system/app to make sure you have one installed as a system app all the time, though make sure to fix its permissions to rw-r--r-- (644).
HQRaja said:
Grab the APK file for the stock launcher (or any launcher of your choice), connect your phone to the computer via USB with debugging on and install the launcher using this ADB command:
adb install launcher.apk
Make sure to replace launcher.apk with the exact name of the APK file, of course. You might need to copy the launcher to your SDK's platform-tools folder and run this command while in that directory as well, if the folder hasn't already been added to your PATH variable.
Once done, reboot your device. You can then use any root-enabled file manager to simply copy the launcher's APK file into /system/app to make sure you have one installed as a system app all the time, though make sure to fix its permissions to rw-r--r-- (644).
Click to expand...
Click to collapse
Thank you for your reply.
I already pushed the the launcher apk through adb and it installed on my phone from everything I can see. However even though it installed I do not know how to start it. I do not know how to gain access to a file manager as I do not access to any of my apps through the app drawer. Is there a way to activate and use an app without being able to access it in the drawer?
That's weird. Did you restart your phone? Upon every restart, Android looks for any installed launcher apps and if there's only a single one installed, it automatically loads it up. In case there are multiple launchers installed, Android loads a default one if set, or offers you to select one if you haven't set any as default. If you have installed a launcher via ADB by now, it should be loading upon device reboot. Try a different launcher's APK maybe? If it still doesn't work, try fixing permissions manually via ADB, or via recovery. Also, try installing it as a system app i.e. adb push Launcher.apk /system/app/ and don't forget to fix permissions to rw-r--r-- (644).
HQRaja said:
That's weird. Did you restart your phone? Upon every restart, Android looks for any installed launcher apps and if there's only a single one installed, it automatically loads it up. In case there are multiple launchers installed, Android loads a default one if set, or offers you to select one if you haven't set any as default. If you have installed a launcher via ADB by now, it should be loading upon device reboot. Try a different launcher's APK maybe? If it still doesn't work, try fixing permissions manually via ADB, or via recovery. Also, try installing it as a system app i.e. adb push Launcher.apk /system/app/ and don't forget to fix permissions to rw-r--r-- (644).
Click to expand...
Click to collapse
I will get right to doing that, and see how it turns out thank you and please stay tuned.
Update: I attempted the command to push it to the system/app and my return read "failed to copy 'apex.apk' to ' /system/app/apex.apk': Read-only file system"
It sounds to me upon reading that, that if I fix permission to make the file system read/write then this command will work. However, I do not know the commend to make that change.
No, you don't get read/write access by fixing permissions. The error that you get asically means you don't have system write access via ADB at the moment. Try this:
Code:
adb remount
adb push Launcher.apk /system/app/
adb shell
su
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
The above method should work if your current kernel is an insecure one (i.e. it allows ADBD running as root and thus, the use of adb remount command for full system read/write access). If that doesn't work, try this:
Code:
adb push Launcher.apk /sdcard/
adb shell
su
mount -o remount,rw /system
mv /sdcard/Launcher.apk /system/app/Launcher.apk
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
HQRaja said:
No, you don't get read/write access by fixing permissions. The error that you get asically means you don't have system write access via ADB at the moment. Try this:
Code:
adb remount
adb push Launcher.apk /system/app/
adb shell
su
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
The above method should work if your current kernel is an insecure one (i.e. it allows ADBD running as root and thus, the use of adb remount command for full system read/write access). If that doesn't work, try this:
Code:
adb push Launcher.apk /sdcard/
adb shell
su
mount -o remount,rw /system
mv /sdcard/Launcher.apk /system/app/Launcher.apk
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
Click to expand...
Click to collapse
I will try both commands and report back thank you!
These are my returns:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You could also try installing a launcher from the Google Play website and hopefully it will install on your phone. Then once you have a working launcher you could more easily restore the factory one.
spunker88 said:
You could also try installing a launcher from the Google Play website and hopefully it will install on your phone. Then once you have a working launcher you could more easily restore the factory one.
Click to expand...
Click to collapse
I can't use Google play because this I have not had this phone registered at all. I only used it to play games and media and never had my account linked to it. I now wish I would have because I agree with you, having done that would ahve made this entire thing a non situation I think.
That's kinda weird. Try the same command with 'cp' instead of 'mv', perhaps that'll help.
According to adb it worked, however I can not access home and the launcher is no longer in my list of installed apps. Very confusing to me
It seems then that you have deleted some other system-critical APK as well, perhaps. A good idea would be to reinstall the ROM now. If you are already running a custom ROM, you can do so without the need to wipe data, by installing the same ROM. In case of stock ROM, you should find a flashable zip file of the same version or a later update, and flash it without wiping data too. Though if that doesn't work either, a ROM flash followed by a full data+cache+dalvik-cache wipe should do it.
Oh speaking of that, try wiping cache and dalvik cache from recovery and rebooting to see if it helps, before you attempt the above.
HQRaja said:
It seems then that you have deleted some other system-critical APK as well, perhaps. A good idea would be to reinstall the ROM now. If you are already running a custom ROM, you can do so without the need to wipe data, by installing the same ROM. In case of stock ROM, you should find a flashable zip file of the same version or a later update, and flash it without wiping data too. Though if that doesn't work either, a ROM flash followed by a full data+cache+dalvik-cache wipe should do it.
Oh speaking of that, try wiping cache and dalvik cache from recovery and rebooting to see if it helps, before you attempt the above.
Click to expand...
Click to collapse
I was already thinking that so I finally found a stock firmware file and am currently attempting to flash it now. I will report back with the results.
Update: The results are in and.....it is now working! This is what I wanted to do from the start but I had a very hard time finding a good link to a stock rom. Mr. Raja I am very thankful for all your help and time you spent with me on this issue.
kingnarkissos said:
I was deleting unused apps from my phone and, like an idiot, I deleted my only installed launcher. The phone boots and I can access the settings. I have a launcher installed and it shows up in menu/ settings/ app but it wont start and I don't know how to start it. I do have adb and fastboot though I don't have wireless internet. This device is not activated and there is no gmail account linked to this device. I did create a zip of a launcher and tried to flash it through recovery but that didn't work. I do not have a custom recovery installed but I did root the device. Is there a way to get a launcher installed and working so I can use this device again?
Click to expand...
Click to collapse
you need to simply install the launcher..
adb install apex.apk
that is all.
kingnarkissos said:
I was already thinking that so I finally found a stock firmware file and am currently attempting to flash it now. I will report back with the results.
Update: The results are in and.....it is now working! This is what I wanted to do from the start but I had a very hard time finding a good link to a stock rom. Mr. Raja I am very thankful for all your help and time you spent with me on this issue.
Click to expand...
Click to collapse
I'm glad it worked out for you. You must have deleted some other system-critical APK as well, otherwise simply reinstalling the launcher via ADB should have worked just fine. In the future, it'll be a good idea not to delete any APKs from /system/app that you aren't absolutely sure about. =)
jimmydafish said:
you need to simply install the launcher..
adb install apex.apk
that is all.
Click to expand...
Click to collapse
That was the first thing I did and it did not work. The app did show up under the installed apps list, but I could not get it to start so it was never running. Therefor I couldn't gain access to it or any area of the device other than settings when the phone booted up. I stated such in the first post of this thread. Believe me I tried all the easy stuff first.
Mr.Raja I do agree with you. I must have deleted more than I thought I did because I agree with you and everyone else who is saying a simple adb flash will work. It should have worked. So whatever I did to it forced me to reflash a rom onto it. I am just thankful to you and everyone else who tried to help me. I appreciate the time spent assisting me.
How I fixed this issue was RSDlite and the rom from this link http://forum.xda-developers.com/showthread.php?t=2017200 and it worked like a charm.
This issue is resolved!
My Verizon LGG2 is now only with twrp 2.7 - no os and when plugged into the computer it cannot go into download mode to flash an os. It also doesn't recognize or install driver softwear as it always does. Am I completely shot or is abd a solution as twrp says something about abd sideload but I know nothing about how to do that although I have read of people doing it before,but not about what they used it for.
Of course any help is most greatly appreciated as the phone is useless to me in this state.
You have to be more specific did you try to flash a ROM/what ROM did you try to flash
Sent from my LG-VS980 using Tapatalk
rnh said:
My Verizon LGG2 is now only with twrp 2.7 - no os and when plugged into the computer it cannot go into download mode to flash an os. It also doesn't recognize or install driver softwear as it always does. Am I completely shot or is abd a solution as twrp says something about abd sideload but I know nothing about how to do that although I have read of people doing it before,but not about what they used it for.
Of course any help is most greatly appreciated as the phone is useless to me in this state.
Click to expand...
Click to collapse
Be more specific. If you can download any ROM that fits your phone model, put it on a flash drive and use OTG cable to connect it to the phone and then flash the ROM.
Thank you spin and coo. To be more specific, I wiped the internal sd by accident and the rom that was on it but I do have the stock os backed up on my computer, When I try to go into download mode - holding down the volume up button and plugging in the cable to use the flash tool to flash the 11b kdz file to the phone, the phone just vibrates and twrp pos up. Before that it would go into fastboot mode but that has disappeared. That is why I say the only thing that appears to be on the phone as far as softwear is twrp. Do you need more info?
rnh said:
Thank you spin and coo. To be more specific, I wiped the internal sd by accident and the rom that was on it but I do have the stock os backed up on my computer, When I try to go into download mode - holding down the volume up button and plugging in the cable to use the flash tool to flash the 11b kdz file to the phone, the phone just vibrates and twrp pos up. Before that it would go into fastboot mode but that has disappeared. That is why I say the only thing that appears to be on the phone as far as softwear is twrp. Do you need more info?
Click to expand...
Click to collapse
OP, check out this post I wrote to someone else. I haven't done it myself, but I helped a buddy over the phone once with the adb sideload option. It was successful and the steps SHOULD be the same even though the reference links in my post are for an HTC phone.
http://forum.xda-developers.com/showpost.php?p=52116786&postcount=559
jas0nnn said:
OP, check out this post I wrote to someone else. I haven't done it myself, but I helped a buddy over the phone once with the adb sideload option. It was successful and the steps SHOULD be the same even though the reference links in my post are for an HTC phone.
http://forum.xda-developers.com/showpost.php?p=52116786&postcount=559
Click to expand...
Click to collapse
Thank you Jas0nnn. Looks promising. Also that otgcable is cheap and it looks as if I could load my backed up computer rom onto a flash drive and install it although I there is no driver softwear installed.
rnh said:
Thank you Jas0nnn. Looks promising. Also that otgcable is cheap and it looks as if I could load my backed up computer rom onto a flash drive and install it although I there is no driver softwear installed.
Click to expand...
Click to collapse
An OTG cable would be nice. But keep in mind you don't need it. You can still use sideload to "push" your backed up ROM from your desktop to your phone and then flash it.
How do I do that? Adb looks complicated. And the instructions which I briefly looked at only speak of pushing rom files, not complete roms.
Sent from my DROID RAZR using Tapatalk
Well I got home from work and installed and extracted the sdk zip after doing extensive reading and lo and behold after unzipping it and hitting download manager the command window pops up and promptly closes. That's it . What do I do now? TIA
rnh said:
Well I got home from work and installed and extracted the sdk zip after doing extensive reading and lo and behold after unzipping it and hitting download manager the command window pops up and promptly closes. That's it . What do I do now? TIA
Click to expand...
Click to collapse
Hmm, I think we have a miscommunication here or the ADB Sideload post is not clear enough.
First, install the ADB drivers. This will allow you to open up a command window prompt (type "cmd" in your windows search in your start menu").
ADB: http://forum.xda-developers.com/showthread.php?t=2588979
Then, you want to boot into TWRP. Plug in your phone to your computer (running Windows w/ ADB drivers installed). Go to advanced->adb sideload (don't know the exact sequence but it should be like this). This should allow you to do the commands from the "Instructions" section of this post:
http://forum.xda-developers.com/showthread.php?t=2318497
Start at step 8. By using the "adb sideload" command, you will be able to transfer a .zip from your desktop to your phone. That way, you can use good ol' TWRP to flash that .zip and get yourself back into a ROM. To use the "adb sideload" command in cmd prompt, you need to first change directory or "cd" into the directory in which you have you .zip file on your desktop. That way when you invoke the command and give it a file name, it'll look in your current directory for it. Good luck and sorry for the late response -- I was on travel.
jas0nnn said:
Hmm, I think we have a miscommunication here or the ADB Sideload post is not clear enough.
First, install the ADB drivers. This will allow you to open up a command window prompt (type "cmd" in your windows search in your start menu").
ADB: http://forum.xda-developers.com/showthread.php?t=2588979
Then, you want to boot into TWRP. Plug in your phone to your computer (running Windows w/ ADB drivers installed). Go to advanced->adb sideload (don't know the exact sequence but it should be like this). This should allow you to do the commands from the "Instructions" section of this post:
http://forum.xda-developers.com/showthread.php?t=2318497
Start at step 8. By using the "adb sideload" command, you will be able to transfer a .zip from your desktop to your phone. That way, you can use good ol' TWRP to flash that .zip and get yourself back into a ROM. To use the "adb sideload" command in cmd prompt, you need to first change directory or "cd" into the directory in which you have you .zip file on your desktop. That way when you invoke the command and give it a file name, it'll look in your current directory for it. Good luck and sorry for the late response -- I was on travel.
Click to expand...
Click to collapse
Hope it was a good trip. Do I still use the the normal ABD or the 1.3 ADB installer and fastboot to push the zip? I feel stupid to ask you to spoon feed me but I'm not a computer person. Do the drivers need to install on the phone because I don't think they will.
Well, I extracted the zip to c and placed the zip file into platform tools but the sdk manager wont open or update and the cmd won't recognize the path to access platform tools and access the zip to install it. Should be simple but I suppose it's not
rnh said:
Hope it was a good trip. Do I still use the the normal ABD or the 1.3 ADB installer and fastboot to push the zip? I feel stupid to ask you to spoon feed me but I'm not a computer person. Do the drivers need to install on the phone because I don't think they will.
Click to expand...
Click to collapse
It's ok, I understand. The community doesn't quite standardize everything or have a central area to learn the environment and such. Abandon the whole platform-tools thing. Stick with the ADB installer as it simplifies things for you.
However here's a quick explanation of how the whole software development kit (SDK) thing works. What typically happens with the instructions of downloading the software development kit (sdk) is you are supposed to download your adb drivers and put them in a folder (like platform-tools). There is an application called adb.exe which you use -- this is called the "adb driver" which relies on all the other files in the same folder where adb.exe is.If you open up cmd and change directory or "cd" into the folder which holds adb.exe, you can type "adb" in the command line to execute the adb.exe program. This is why the instructions tell you to place the .zip file of interest in the same folder as adb.exe.
The 1.3 ADB installer will install the same files (adb.exe and associate files) and point the command prompt, cmd, to adb.exe, regardless of what directory you're currently in while using cmd. So whether I am currently in C:\ or C:\Users\jas0nn, I can type "adb" in command prompt, and the application will execute. With the the method above, you have to specifically change directory into the folder which holds adb.exe in order to invoke the adb application in the command prompt. To check if your phone is recognizable, you can type "adb devices" in cmd and see if a device number pops up. If so, you're connected. I did forget to mention that you need to make sure your LG G2 USB drivers are installed. You can find them here: http://wacomalt.com/dropbox/LGG2/StockRevert/LG VZW_United_WHQL_v2.11.1.exe
tl;dr: ditch the SDK installer route. Use the 1.3 ADB installer and push the zip into your phone using adb sideload. You need the drivers from here: http://wacomalt.com/dropbox/LGG2/StockRevert/LG VZW_United_WHQL_v2.11.1.exe in order to successfully communicate to your phone via adb.
jas0nnn said:
It's ok, I understand. The community doesn't quite standardize everything or have a central area to learn the environment and such. Abandon the whole platform-tools thing. Stick with the ADB installer as it simplifies things for you.
However here's a quick explanation of how the whole software development kit (SDK) thing works. What typically happens with the instructions of downloading the software development kit (sdk) is you are supposed to download your adb drivers and put them in a folder (like platform-tools). There is an application called adb.exe which you use -- this is called the "adb driver" which relies on all the other files in the same folder where adb.exe is.If you open up cmd and change directory or "cd" into the folder which holds adb.exe, you can type "adb" in the command line to execute the adb.exe program. This is why the instructions tell you to place the .zip file of interest in the same folder as adb.exe.
The 1.3 ADB installer will install the same files (adb.exe and associate files) and point the command prompt, cmd, to adb.exe, regardless of what directory you're currently in while using cmd. So whether I am currently in C:\ or C:\Users\jas0nn, I can type "adb" in command prompt, and the application will execute. With the the method above, you have to specifically change directory into the folder which holds adb.exe in order to invoke the adb application in the command prompt. To check if your phone is recognizable, you can type "adb devices" in cmd and see if a device number pops up. If so, you're connected. I did forget to mention that you need to make sure your LG G2 USB drivers are installed. You can find them here: http://wacomalt.com/dropbox/LGG2/StockRevert/LG VZW_United_WHQL_v2.11.1.exe
tl;dr: ditch the SDK installer route. Use the 1.3 ADB installer and push the zip into your phone using adb sideload. You need the drivers from here: http://wacomalt.com/dropbox/LGG2/StockRevert/LG VZW_United_WHQL_v2.11.1.exe in order to successfully communicate to your phone via adb.
Click to expand...
Click to collapse
Well that was quick jas0nn. Thank you. The abd drivers nexus one installed from the abd google drivers but not the lg g2 drivers. Typing abd devices in cmd brings up not recognized. Guess I'm screwed unless you have any other suggestions.
rnh said:
Well that was quick jas0nn. Thank you. The abd drivers nexus one installed from the abd google drivers but not the lg g2 drivers. Typing abd devices in cmd brings up not recognized. Guess I'm screwed unless you have any other suggestions.
Click to expand...
Click to collapse
Install the LG G2 USB drivers I showed you above.
Enter yes to every option in the ADB Installer v1.3 while installing.
If you get a message "'adb' is not recognized as an.." then you have not successfully installed the adb drivers via the adb installer v1.3.
You're not screwed quite yet. Typically there is always a solution in the engineering world ;].
Here is a pic of the commands I tried
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my DROID RAZR using Tapatalk
rnh said:
Here is a pic of the commands I tried View attachment 2712870
Sent from my DROID RAZR using Tapatalk
Click to expand...
Click to collapse
"adb" not "abd." "adb" for "android debug bridge."
Sent from my DROID RAZR using Tapatalk
rnh said:
View attachment 2712879
Sent from my DROID RAZR using Tapatalk
Click to expand...
Click to collapse
Looks like your device is connected. Feel free to read the help pages by typing "adb help."
Good luck.
For whatever reason, my phone was in the same situation as yours where I could only reboot into twrp. I found a pretty easy solution below:
before trying anything else just type in these commands
What worked for me was from the TWRP terminal command was to type
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
then hit enter
type
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
then hit enter and reboot.
got help from the IRC xda-devs for the second step to complete the fix.
It worked for me and now my phone seems to be running normal. The whole thread is located here:
http://forums.androidcentral.com/ge...ricked-lg-g2-stuck-twrp-no-download-mode.html
I think my phone somehow took the OTA while I had KK rooted installed. I plugged in my device to charge and got up to get a drink and when I came back my friend's cat was playing with the charger cable and my phone was in twrp. Went the whole weekend on vacation without my phone. It was rough. All seems well now.
Edit: I think I had to enter everything in twice. 1st time it worked but then rebooted back into twrp on it's own, the 2nd time it worked. Hope it helps.
Please note, I can only speak with any degree of certainty about devices bought from Play / Moto. I cannot attest to the accuracy of this information for US carrier versions etc. Anything you do is at your own risk
Contents / Thread overview
Introduction
What is Fastboot?
What is adb?
How to install adb and fastboot
How to test adb and fastboot work
OK Gimme some useful fastboot commands please!
OK Gimme some useful adb commands please!
A little more about using Windows command prompt
Myth Busters
Introduction
adb and fastboot are very useful command line tools. They can be used from Windows, Linux or Mac to carry out tasks on your android device, such as moving and backing up files, rooting and restoring your phone to it's factory state. Understanding how to use these tools could save your phone when you get yourself in trouble. This is especially true of rooted users. Particularly those of you who are "new to the scene". You definitely should read and understand this thread before you do ANYTHING root related.
This thread is not intended to be a non-exhausted reference. It is merely here to give an overview of the most basic of basics
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
What is fastboot?
Fastboot comprises of 2 components.
1) Fastboot mode on the phone (The Bootloader)
2) Fastboot tool on your computer
Fastboot is a small command line tool that you can use from your computer whilst the phone is connected via USB and you are booted into the bootloader. The most common uses for fastboot are:
Unlocking the bootloader - needed as part of the rooting process
Flashing a custom recovery to the device - needed as part of the rooting process
Flashing factory images - used for saving / trestoring your device back to stock
Being able to do these 3 things are essential before rooting. Many new users skip learning these and use a toolkit to root. As a result, when they mess up and we try to explain what they need to do to fix their issues, it becomes very difficult for us to help as fastboot is not understood. It is YOUR responsibility to understand these things BEFORE you mess up.
What is adb?
adb is another small command line tool that stands for "Android Debugging Bridge". Again, it can be used from a computer connected via USB to your android device. It can be used whilst the device is booted into Android or (if you have a custom recovery), it can be used in recovery too, unlike fastboot (yes, adb and fastboot are NOT the same thing) which can only be used in the bootloader.
adb can be used to push files to (or pull files from) your phone. It can also be used to execute many of the commands available in Linux terminals (Or Android terminal emulators) on the device itself. We're not here to cover all these commands however. We just want to cover the basics.
How to install adb and fastboot
adb and fastboot are very easy to install and can be installed on Windows, Linux and MAC computers. The Windows install can be a little bit more complicated than the other 2 and may need additional drivers installing too.
Windows.
There is a very handy tool that can install adb and fastboot in 15 seconds. It is recommended that you use this to install adb and fastboot. Please see the link immediately below for that tool:
ADB, Fastboot and Drivers - 15 seconds ADB Installer - Really quick and easy way to install adb and fastboot (by @Snoop05). Download links are at the bottom of post 1.
This tool asks if you want to install adb and fastboot (to which you should answer Y) and then creates c:\adb\adb.exe and c:\adb\fastboot.exe
It then asks if you want to install it system wide .. This is asking to install for all windows users. < 15 second installer needs updating to SDK 23, which is required for latest Android versions.
Download the latest SDK (adb and fastboot) versions here: https://developer.android.com/sdk/index.html (Scroll down to SDK tools only) then download the Windows *Installer*.
Open the installer and select "Platform-tools" and install the packages. This should create "C:\Program Files (x86)\Android\android-sdk\platform-tools"
Now we want to set this path as a Windows Environment variable PATH to make the executables work system wide:
right-click computer > properties > advanced > environment variables.
under system variables click "path" and click "edit"
at the end of the line, add the below:
Code:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Please note, the semi-colon ; is VERY important.
You may also need to install drivers.
Here is a link to the Google USB Driver: DOWNLOAD THIS
Code:
To install on Windows 7:
- Ensure existing drivers are uninstalled first*
- Extract the zip to c:\adb (created earlier by the installer)
- Right-click "Computer" > Manage in windows and choose "Device Manager"
- Boot the Nexus 6 to the bootloader (Volume down + Power) and connect the USB Cable
- Watch for any new devices with exclamation marks appearing
- Right-Click the new device > Update driver software
- Choose the "browse" method and browse to c:\adb, find teh folder you extracted then follow the wizard to the end - using amd6 64 if you're on a 64 bit system and i386 if you're on a 32 bit system.
*To uninstall existing drivers, boot into Android and connect the USB cable. Monitor device manager for the device showing up. To uninstall the device, right-click it to uninstall it. At the prompt, ensure you also choose to delete the driver. Repeat this for bootloader and recovery.
Code:
To Install on Windows 8, you may need to additionally disable driver enforcement
- From the Metro Start Screen, open Settings (move your mouse to the bottom-right-corner of the screen and wait for the - -- pop-out bar to appear, then click the Gear icon).
- Click ‘More PC Settings’.
- Click ‘General’.
- Scroll down, and click ‘Restart now’ under ‘Advanced startup’.
- Wait a bit.
- Click ‘Troubleshoot’.
- Click ‘Advanced Options’
- Click ‘Windows Startup Settings’
- Click Restart.
Once that is done, your Windows computer is configured for adb and fastboot.
In device manager, the device should show up as below, depending whether you are booted into recovery or bootloader...
Recovery - Android Device > Google Nexus 4 ADB Interface
Bootloader - Android Device > Google Nexus 4 Bootloader Interface
If it shows as something different, either you have existing drivers in the way or something went wrong.
Linux and Mac
Here is a really simple tool to install adb and fastboot on the above OS. The only expectation is you know how to open and run a terminal command. Please see the link immediately below:
Nexus Tools 2.2 (Featured by XDA) - adb and fastboot installer for Linux and Mac (by @corbin052198)
Once you have installed adb and fastboot from the above link, you're ready to go.
How to test adb and fastboot work
As previously mentioned, adb and fastboot are both command line tools. That means you must run these tools from command prompt (cmd in Windows) or Terminal (Linux and Mac).
Remember earlier, I mentioned that fastboot can only be used in bootloader? and adb can only be used in Android (or custom recovery - lets cover that later)? We can use the command "fastboot devices" and "adb devices to see if we have adb and fastboot working correctly.
Lets try it.
Boot your phone into android
Connect it to your computer via USB
Open cmd (start > type "cmd" on Windows) or Terminal (Mac/ Linux
Type in the windows "adb devices" and press enter
Here is what we don't want to see:
Notice how there is nothing underneath where it says "List of attached devices" That means it cannot see any device
Here is what we DO want to see:
We can see that there is now a device listed.
OK lets test fastboot. Unplug the USB and turn off the phone. When it is off, hold down Volume down + power until you feel the vibrate. You will now be in the bootloader. Reconnect the USB cable.
In the same window (cmd or terminal) we're going to now type "fastboot devices".
Again, here is an example of what we don't and do want to see:
If in both modes, you can see your devices "Serial Number", then you know they are both working.
Please note that if you cannot get adb and fastboot to work "system wide", you can open the command prompt to the location of the adb and fastboot executables exist and try from there.
OK Gimme some useful fastboot commands please!
Here are some of the most useful fastboot commands you will come across. Fastboot is used mostly for flashing images to the devices partitions on the internal memory.
Code:
fastboot oem unlock
This unlocks your bootloader and allows you to flash a recovery to root. WARNING, this will wipe your device. Rooting the N6 is essentially unlocking the bootloader, flashing a recovery and then putting the SuperSU zip on your sdcard and flashing it via the recovery. This thread covers rooting: [HOW-TO] The Nexus 6 All-In-One Beginner's Guide by @xBeerdroiDx
Code:
fastboot flash recovery recovery.img
This will flash a recovery.img to the recovery partition. The command is broken down into "fastboot flash" (what to do) "recovery" (where to flash to) "recovery.img" what to flash there. In the terminal or command prompt, you cannot just type "recovery.img" though. It has to be the path to where the recovery image is. For example, if my recovery image is on my desktop, I would have to type:
Code:
fastboot flash recovery c:\users\rootsu\desktop\recovery.img
It is worth noting, that it IS case sensitive, meaning if your file is called Recovery.img, you must type the capital R...
Other things you would flash:
Code:
fastboot flash system system.img
fastboot flash boot boot.img
These will flash the system image (ROM) and boot image (kernel) as you would if you were returning to stock.
A full guide to returning to stock can be found here: [TUTORIAL][GUIDE][HOW TO] Flash Factory Images || Unroot || Relock bootloader by @Mr hOaX
You can also boot into a recovery.img without flashing it...
Code:
fastboot boot c:\users\rootsu\desktop\recovery.img
which is "fastboot boot" (what to do) "c:\users\rootsu\desktop\recovery.img" what to do it with. As you may have noticed, we did not define the recovery partition in this command, that's because we're not flashing it....
OK Gimme some useful adb commands please!
At the moment, we are going to assume you have a custom recovery and you have booted into recovery. The reason for this is using adb in recovery can be much simpler.
Here are some useful scenarios for using adb.
Backup your sdcard to your PC
Code:
adb shell
mount data
exit
adb pull data/media/0 c:\MyBackup
**Please note, some recoveries may "mount data" automatically on boot, so don't be disheartened if you get an error stating device or resource busy. This probably just means you can't mount what is already mounted**
/data/media/0 is the real location of /sdcard for your information. Also referred to as "The mount point". What we have done here is "adb pull" (what to do) "data/media/0" (what to move) "c:\MyBackup" (where to move it to)
Push a zip file from your PC to your sdcard (useful if you wiped your sdcard and rom)
Code:
adb shell
mount data
exit
adb push c:\rom.zip data/media/0
What we have done here is "adb push" (what to do) "c:\rom.zip" (what to move) "data/media/0" (where to move it to)
You can of course also use adb to push and pull files to and from /system too. You just need to:
Code:
adb shell
mount system
exit
I mentioned earlier that using custom recovery is much easier for adb than whilst booted into Android. You need to ensure you have a kernel that allows insecure adb before you do anything with system and data partitions. You also need to ensure that USB debugging has been enabled in developer options.
For example, to mount system to pull files whilst android is running you have to:
Code:
adb root
adb shell
mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
...which is clearly a little bit more involved, so I recommend you use recovery for adb push and pull. You can find more detailed information on adb here: http://developer.android.com/tools/help/adb.html
A little more about using Windows command prompt
One thing to understand is that like Windows, command prompt (cmd.exe) works with directories (or folders if you like). The Linux and Mac terminals are the same, but most linux users, we expect you would already know this.
Here you will see I have downloaded a recovery image that I want to flash using fastboot.
As you can see, the recovery.img is located in C:\users\rootSU\Desktop
Usually when you open the command prompt from the start menu, or run command, the command prompt will default to your user location as seen below:
So lets try and fastboot flash recovery recovery.img...
It fails with a not-too-accurate error message. It has failed because you have not told it where the recovery image is. It assumes it is in the directory as listed in the prompt
So, how do we deal with this? Well, there are 3 ways.
1) We tell the command prompt where the recovery.img actully is in the command itself
Success! As you can see, we have told the command that the location for the file is Desktop\recovery.img
2) We can change the directory in command prompt to the directory where the file is. In this example, we change directory to "Desktop". The change directory command is "cd " or in this case "cd Desktop"
3) ...and possibly the simplest method. We hold shift whilst we right-click on the folder we want to change directory to, and directly open a command prompt there:
Another point to make with command prompt or terminals, is if you do a particular command, it is "pre-programmed" to "expect" a particular format of that command.
For example, we know that adb push as a command expects after it . This means the command is actually
Code:
adb push
BUT if you put something AFTER , for example -
Code:
adb push somethingelse
, it will assume that the "somethingelse" is a bad parameter, and the command will fail. It will probably display (or "print" which is the technical term in a terminal) a helpful guide of how the command should be used instead of trying to run the command which it does not understand.
You're probably wondering why I am telling you this. Well quite simply, it is a warning about folder names. Imagine you have c:\users\rootSU\My Documents as a folder. You assume the command is then
Code:
adb pull /data/media/0 c:\users\rootSU\My Documents
but it is not... There is a space in between My and Documents. What you have actually done is
Code:
adb pull Documents
because it uses a space to signify the end of a command or parameter. It is best to avoid using folders with spaces in them. Avoid as much as you can. In the event it is unavoidable (Although when is it ever>) then please surround the path with quotation marks,
Code:
adb pull /data/media/0 "c:\users\rootSU\My Documents"
so that way, it sees everything between the " " as a single parameter.
Myth Busters
Myth 1: You need USB debugging on to use adb and fastboot
If you cannot boot into Android, it doesn't matter. You DO NOT need USB Debugging turned on to use adb outside of android. USB Debugging is an Android ONLY setting. Fastboot obviously also does not need debugging either as this too is outside of Android
Myth 2: to adb push or fastboot flash files, they must be in the same folder as adb or fastboot executables. Sorry but this is rubbish. You can pass the full path of the image you're flashing or file you're pushing in the command and fastboot / adb can be called system wide if you've set them as an environment variable or used the 15 second installer
thanks(im out of thanks). but ill be back to leave one here!!!!!
simms22 said:
thanks(im out of thanks). but ill be back to leave one here!!!!!
Click to expand...
Click to collapse
No worries. Just putting it here for info. It's not a new work, just a slightly amended version of my N5 thread. No need for thanks
rootSU said:
No worries. Just putting it here for info. It's not a new work, just a slightly amended version of my N5 thread. No need for thanks
Click to expand...
Click to collapse
it was up in the n5 threads before, and was needed here. but its here now as well, so thank you
Good guide. Needs to be a sticky. In fact, I think every device general forum should have a sticky like this. Would have saved me a lot of grief back when....
Excellent update.
Very good to see. I'm sure lots of people will be sending noobs here for the basics.
Up to your usual helpful, good work I see.
rootSU said:
This tool asks if you want to install adb and fastboot (to which you should answer Y) and then creates c:\adb\adb.exe and c:\adb\fastboot.exe
It then asks if you want to install it system wide (to which again, you should answer Y)... This then allows you to type adb commands in the command prompt without having to open a particular directory first. You may or may not understand what I mean when I say that, but take it from me, its much more convenient and easier to use this way.
Click to expand...
Click to collapse
Y option = System-wide = install to "C:\adb" and add path for system variable - This mean you can use it by any account on your pc.
N option = Current user only = install to "C:\Users\[YOUR USERNAME]\adb" and add path for user only - Only user account used for installation can actually use it.
So if you say Y or N you will be still able to use it from any directory with cmd.
rootSU said:
It will also ask if you want to install device drivers. Actually, say N to this as we're going to cover that next, using the google USB drivers
Here is a link to the Google USB Driver: DOWNLOAD THIS
Click to expand...
Click to collapse
Drivers in my installer are the one from the link you posted here. I'm not using any modified drivers, just the one that come with SDK. And they are also digitally signed.
I hope you will fix these But still nice work, beginners should understand it :good:
Snoop05 said:
Y option = System-wide = install to "C:\adb" and add path for system variable - This mean you can use it by any account on your pc.
N option = Current user only = install to "C:\Users\[YOUR USERNAME]\adb" and add path for user only - Only user account used for installation can actually use it.
So if you say Y or N you will be still able to use it from any directory with cmd.
Drivers in my installer are the one from the link you posted here. I'm not using any modified drivers, just the one that come with SDK. And they are also digitally signed.
I hope you will fix these But still nice work, beginners should understand it :good:
Click to expand...
Click to collapse
Thanks for the info. I thought system wide meant it was putting it as a path environment variable. Reason I didmt use the drivers from your tool originally is (well I wrote this thread for N5 originally) they didnt work so had to install the universal naked driver. But if yours are the same as the ones linked, I can update that.
rootSU said:
Thanks for the info. I thought system wide meant it was putting it as a path environment variable. Reason I didmt use the drivers from your tool originally is (well I wrote this thread for N5 originally) they didnt work so had to install the universal naked driver. But if yours are the same as the ones linked, I can update that.
Click to expand...
Click to collapse
Path is added in both cases.
Sooo I need a little help here. I followed the directions to unlock the bootloader and everything went good. I did the CF auto-root, and the phone booted back up as normal. Now, I was trying to flash the M preview, and all of a suddon now my phone isn't recognized in adb. You posted a pic of what we don't want to see when testing for adb, but you don't say how to fix it if we run into the problem. Any way to get it to recognize my phone again so I can get this build on?
papeshfoo said:
Sooo I need a little help here. I followed the directions to unlock the bootloader and everything went good. I did the CF auto-root, and the phone booted back up as normal. Now, I was trying to flash the M preview, and all of a suddon now my phone isn't recognized in adb. You posted a pic of what we don't want to see when testing for adb, but you don't say how to fix it if we run into the problem. Any way to get it to recognize my phone again so I can get this build on?
Click to expand...
Click to collapse
Can you be very specific with your issue please?
papeshfoo said:
Sooo I need a little help here. I followed the directions to unlock the bootloader and everything went good. I did the CF auto-root, and the phone booted back up as normal. Now, I was trying to flash the M preview, and all of a suddon now my phone isn't recognized in adb. You posted a pic of what we don't want to see when testing for adb, but you don't say how to fix it if we run into the problem. Any way to get it to recognize my phone again so I can get this build on?
Click to expand...
Click to collapse
Android M no like root, you'll either have to live with stock or wait for chainfire to do his thing.
This all worked well until I had to find my device in the cmd prompt. It listed no devices when I typed in "ADB Devices". The issue I found was with the ADB Interface Driver. I uninstalled it and reinstalled it thinking it might've been a driver issue, but it still wouldn't work. I tried the "Uninstall driver" then "scan for hardware changes" but that didn't work. Finally I found the universal ADB driver and tried using that. STILL nothing. I figured that, because I don't have my device's driver installed, it might've been that, so I tried to DL it and yet again, nothing. I have a Kyocera Hydro Life, if that helps. Also, I tried looking through the "update driver manually" in order to update the driver software by looking through the different ADB interfaces that it had but my Kyocera driver wasn't there. Is it supposed to be there or do I just use one of the ones provided?
I checked my programs and apps and it says that the Kyocera usb driver was installed. Did I do something wrong?
ScottyChaos said:
This all worked well until I had to find my device in the cmd prompt. It listed no devices when I typed in "ADB Devices". The issue I found was with the ADB Interface Driver. I uninstalled it and reinstalled it thinking it might've been a driver issue, but it still wouldn't work. I tried the "Uninstall driver" then "scan for hardware changes" but that didn't work. Finally I found the universal ADB driver and tried using that. STILL nothing. I figured that, because I don't have my device's driver installed, it might've been that, so I tried to DL it and yet again, nothing. I have a Kyocera Hydro Life, if that helps. Also, I tried looking through the "update driver manually" in order to update the driver software by looking through the different ADB interfaces that it had but my Kyocera driver wasn't there. Is it supposed to be there or do I just use one of the ones provided?
I checked my programs and apps and it says that the Kyocera usb driver was installed. Did I do something wrong?
Click to expand...
Click to collapse
Try a different USB port. If that doesn't work try a different USB cable. If that also doesn't work, you could try disabling driver signature checking for Windows.
If those don't work, try this thread > http://forum.xda-developers.com/showthread.php?t=1583801
cam30era said:
Try a different USB port. If that doesn't work try a different USB cable. If that also doesn't work, you could try disabling driver signature checking for Windows.
If those don't work, try this thread > http://forum.xda-developers.com/showthread.php?t=1583801
Click to expand...
Click to collapse
EDIT: I also forgot to mention that the error code that came up while I was in the dev manager was compatibility error code (28) when I clicked on "Device ADB interface".
ScottyChaos said:
EDIT: I also forgot to mention that the error code that came up while I was in the dev manager was compatibility error code (28) when I clicked on "Device ADB interface".
Click to expand...
Click to collapse
Error 28 means drivers not installed. Try the driver help thread that I linked above.
---------- Post added at 12:33 PM ---------- Previous post was at 12:04 PM ----------
cam30era said:
Error 28 means drivers not installed. Try the driver help thread that I linked above.
Click to expand...
Click to collapse
@ScottyChaos,
Just a fundamental question: I assume you have enabled "Developer Options" in Settings, and then checked "enable USB debugging"?
---------- Post added at 12:39 PM ---------- Previous post was at 12:33 PM ----------
[/COLOR @ScottyChaos,
Here is a thread that you might find interesting > http://forum.xda-developers.com/android/help/metro-pcs-kyocera-hydro-life-rooted-t2870678
Windows 10 device driver management is even more locked down then windows 8. I got two of the three drivers loaded but when going into adb mode on the phone through recovery it just disappeared out of the device manager. I had to unplug and plug in while in that mode to trigger a unloaded driver in the device manager. Once there I had to force the adb driver manually with the nasty windows driver warning and all. Once I did that I could see the device in adb mode and sideload my marshmallow OTA. woot!
I decided to drop a thanks bomb...
ADB is good.
But that fastboot.
Seriously, its ONE command. OK, a few different arguments to use.... But it is so easy, and so powerful. People are afraid to mess up on command line, but its actually way harder to type the wrong thing out then to click the wrong thing.
LEARN IT. Forget your toolkit.
You can fix almost anything, Its not too hard for you. It may be new... YOU CAN DO IT.
Also, I have to say it... Its not going to help anyone, but it will keep me from punching something. ADB and Fastboot... Not the same. You don't ADB a new system image....