Cannot Revoke USB Debugging Authorizations - Moto G5 Plus Questions & Answers

So I've come across a quirk that I haven't been able to resolve and haven't noticed before getting my G5. When I run
Code:
adb devices
on my computer with my phone connected, it shows my device but says unauthorized. I cannot seem to authorize my device. I have tried:
Revoke USB Debugging Authorizations (option not available in Developer Options)
Delete adb_keys in /data/misc/adb/ (No adb_keys file in the folder)
Create adb_keys file on my computer using the computers public key (Phone deletes this file on boot)
I realize this is more of a general Android question, but as it hasn't happened to me on any other phone, I wanted to see if anyone else was having this trouble.

Same boat here, haven't been able to fix the issue. I believe there's a testboot3.img floating around that fixes it. I downloaded it awhile ago as I keep a eye on everything for this device. But I don't know if it does and if you flash a new boot.img I'd think it would override it. I've tried your method as well.

I am also having this issue. Does anyone have a solution?

To update this for those that need it; this toolkit worked to fix this issue for me in Linux. I just hit the red block in the upper left that says "unauthorized device" when the phone was plugged in. Not sure what the kit did but then my phone finally asked if I wanted to allow the computer access. After doing that I finally got "authorized" when running "adb devices" in ubuntu.
https://forum.xda-developers.com/g5-plus/development/toolkit-moto-g5-plus-toolkit-root-t3605203

A fix if you are running Windows (or Linux)
I just found a fix that worked for me.
(Although i got the "unauthorized" status with the phone running as usual, I didn't get the same problem when in recovery mode.)
I followed instructions from this site but needed to change Linux commands to simliar Windows commands: http://www.neuraldump.com/2017/05/how-to-fix-adb-unauthorized-error/
If you are using Windows, you'll need to follow the commands below:
- First things first:
- Phone: Check if you have a file called adb_keys located at: /data/misc/adb/adb_keys. If you have it, i would recommend you to backup the file. (I didn't have it.)
- Windows:You'll need to have a file called adbkey.pub located at C:\users\UserAccount\.android\
- Boot into recovery mode.
- Plug your phone into PC.
- Open cmd and run adb devices. It would show "recovery" instead "unauthorized".
- Create a new file called adb_keys file on your PC:
Code:
type NUL > adb_keys
- Now you need to copy the contents from the adbkey.pub to adb_keys, the new file you just created:
adbkey.pub is located at C:\users\UserAccount\.android\
(Needless to say you need to replace "UserAccount" when running the command)
Code:
type c:\users\UserAccount\.android\adbkey.pub > adb_keys
- Upload the adb_keys file to your phone:
Code:
adb push adb_keys /data/misc/adb/adb_keys
- Reboot and run adb devices. It should be working now.
(Thanks to Tony, the guy who posted this fix in his blog).

need help please. Cant do it. I have that problem on my moto g5 plus. Dont understand this. Windows 10 pro computer.
Edit: I solved using the adb_keys from my xperia and using root explorer on my moto g5 plus and paste on data/misc/adb/adb_keys

Awesome! You may need to change permissions like I did from using root user within a debian chroot. Just like ssh keys....
From twrp recovery console.
chmod 0644 /data/misc/adb/adb_keys
chown -u shell /data/misc/adb/adb_keys
That got me authorized and running a root shell to spoof fingerprint before getting past first Hello page of setup

Yep, it works on my side as well on a Samsung galaxy Note 3, RROS 8.6.1, very good tip!:good:

@mnoguti
thank you, this fix my Verizon Note 4 issue with Smali Patcher not detecting my phone.

Thank you! My Galaxy S4 GT-i9505 also had this issue and your guide let me succesfully use adb normally again!

mnoguti said:
A fix if you are running Windows (or Linux)
I just found a fix that worked for me.
(Although i got the "unauthorized" status with the phone running as usual, I didn't get the same problem when in recovery mode.)
I followed instructions from this site but needed to change Linux commands to simliar Windows commands: http://www.neuraldump.com/2017/05/how-to-fix-adb-unauthorized-error/
If you are using Windows, you'll need to follow the commands below:
- First things first:
- Phone: Check if you have a file called adb_keys located at: /data/misc/adb/adb_keys. If you have it, i would recommend you to backup the file. (I didn't have it.)
- Windows:You'll need to have a file called adbkey.pub located at C:\users\UserAccount\.android\
- Boot into recovery mode.
- Plug your phone into PC.
- Open cmd and run adb devices. It would show "recovery" instead "unauthorized".
- Create a new file called adb_keys file on your PC:
Code:
type NUL > adb_keys
- Now you need to copy the contents from the adbkey.pub to adb_keys, the new file you just created:
adbkey.pub is located at C:\users\UserAccount\.android\
(Needless to say you need to replace "UserAccount" when running the command)
Code:
type c:\users\UserAccount\.android\adbkey.pub > adb_keys
- Upload the adb_keys file to your phone:
Code:
adb push adb_keys /data/misc/adb/adb_keys
- Reboot and run adb devices. It should be working now.
(Thanks to Tony, the guy who posted this fix in his blog).
Click to expand...
Click to collapse
Thank you so much, you saved my life

Related

How to push files through ADB

Prerequisites have...
A:android-sdk-windows installed
B: (on your phone) go to menu>settings>applications>developement and make sure usb debugging is checked.
C: the file you are pushing must be placed in the tools folder of adb so if you are pushing file "build.prop.txt" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\tools
1: go to run and type cmd (or just open your command prompt)
2: cd C:\android-sdk-windows\tools
3: adb remount
4: adb devices *if everything is set up right this should output a serial number*
5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices example adb push build.prop.txt /system/bin
6. repeat step 3 for multiple files
7. adb reboot this is how you finish
usadevil7193 said:
hi mate...i m new to android..i own a nexus1..hav rooted without unlockin d bootloader..i am tryin to push d track ball to wake mod...evry time i type adb remount it says permission denied..any ideas to get things workin...???????
Click to expand...
Click to collapse
Welcome to XDA and Android! Are you trying to get help for your Nexus One? This forum here is specifically for the HTC Hero CDMA.
You will probably find better and more specific help in the Nexus One forums which are here: http://forum.xda-developers.com/forumdisplay.php?f=556
Great post, very easy to follow, thank you.
yea I'm trying to do this, over and over, but with not luck. i have sdk on my pc and im running the cmd prompt to run adb remount & devices and its not picking up the phone, wth is going on, plz help
this also works for the samsung Galaxy S in recovery mode.
mikeybonez28 said:
yea I'm trying to do this, over and over, but with not luck. i have sdk on my pc and im running the cmd prompt to run adb remount & devices and its not picking up the phone, wth is going on, plz help
Click to expand...
Click to collapse
mine shows up but then says error, device offline
hi, i have adb recognizing my phone, but i still can't seem to push the files over.... every time i try, i get 'cannot stat 'su' : No such file or directory'. i have made sure over and over to put the files in the same folder where adb is.... actually i have tried placing the files in the tools folder, as well as the platform-tools folder, and i keep getting that error when i try to push anything.
any suggestions? thx
yogi2010 said:
hi, i have adb recognizing my phone, but i still can't seem to push the files over.... every time i try, i get 'cannot stat 'su' : No such file or directory'. i have made sure over and over to put the files in the same folder where adb is.... actually i have tried placing the files in the tools folder, as well as the platform-tools folder, and i keep getting that error when i try to push anything.
any suggestions? thx
Click to expand...
Click to collapse
i had the same issue with something i was trying to push. I think you need to make sure you have exactly the same file name like caps and all. i was trying to push rootexplorer.apk and i got the same message but i then changed it to RootExplorer.apk and it work.(notice the difference in caps)
just watch this and it'll explain everything.
http://www.youtube.com/xdadevelopers
Does it matter where sdk is installed my file path is
C:\Program Files\Android\android-sdk\tools
instead of
C:\android-sdk-windows\tools.
I just installed it in the default location.
I type adb remount and get the not recognised command.....
Thanks.
I don't think my phone is being picked up?
{LCD}Stelios said:
Does it matter where sdk is installed my file path is
C:\Program Files\Android\android-sdk\tools
instead of
C:\android-sdk-windows\tools.
I just installed it in the default location.
I type adb remount and get the not recognised command.....
Thanks.
I don't think my phone is being picked up?
Click to expand...
Click to collapse
Make sure your have the drivers for your phone installed first of all.....Then, in your command prompt you have to change directories to the sdk (which you made harder by not installing to C:\
Try: cd Program Files\Android\android-sdk\tools
Then type: adb devices
That should return "xxxxxxdevice" connected....Then you know you have it set up.
Look in kyouko sig he has all the commands for adb
Sent from my HERO200 using XDA App
Bierce22 said:
just watch this and it'll explain everything.
http://www.youtube.com/xdadevelopers
Click to expand...
Click to collapse
great video arse....thanks for the help donkey
Flashing fresh ROM via ADB in Linux
Hello there.
M volumeUp and VolumeDown buttons are broken on my rooted Desire HD, so I cannot go through CWM any longer.
With regard to this post, I would ask the followings:
1) can this method be used to flash a new ROM (i.e. Coredroid, Leedroid..) without the need of those 2 buttons ?
2) My PC runs Linux. How does it work with this O.S. ?
Thanks
paolo
pacut said:
Hello there.
M volumeUp and VolumeDown buttons are broken on my rooted Desire HD, so I cannot go through CWM any longer.
With regard to this post, I would ask the followings:
1) can this method be used to flash a new ROM (i.e. Coredroid, Leedroid..) without the need of those 2 buttons ?
2) My PC runs Linux. How does it work with this O.S. ?
Thanks
paolo
Click to expand...
Click to collapse
There is a thread somewhere on how to flash without a SD card and flashed using adb I believe, but don't take my word for it. Adb works fine with Linux, just have to set it up differently. Look in my sig and select the compile aosp on Ubuntu one and follow instructions on getting the USB set up.
Sent from Dorian's HTC Hero CDMA
Yes, I saw it. It's http://forum.xda-developers.com/showthread.php?t=911228
The fact is...still have to navigate through menu via VolumeUp/volumeDown buttons
Maybe through ROM manager, premium, I can install ROM direclty.
I am gonna trying
YES ! It works !
Hi I need help. I accidentally wipped my phone in CWM and now I'm trying to use adb push to push the update.zip into my phone sd everything seems to work but then in CMW it says there are no files..
any suggestions?
[Edit]
nevermind
I kept trying different locations
not sure which one did the trick but I'll list the one's I tried
so \update.zip /sdcard/
.... /sdcard/update.zip
(note I put "/update.zip" thinking maybe it needed to be reallocated to the same file/destination
Can i use adb push *.apk /system/app to push several files at once, and then repeat but using *.odex instead of *.apk? I keep ending up getting the same error, and i want to find out which app is messing with me...
rulermon said:
Prerequisites have...
A:android-sdk-windows installed
B: (on your phone) go to menu>settings>applications>developement and make sure usb debugging is checked.
C: the file you are pushing must be placed in the tools folder of adb so if you are pushing file "build.prop.txt" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\tools
1: go to run and type cmd (or just open your command prompt)
2: cd C:\android-sdk-windows\tools
3: adb remount
4: adb devices *if everything is set up right this should output a serial number*
5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices example adb push build.prop.txt /system/bin
6. repeat step 3 for multiple files
7. adb reboot this is how you finish
Click to expand...
Click to collapse
Hey guys ...
I have also rooted my phone , everything was OK until one day i tried to write something to /system/app and i recieve this error:
in Addition , i am writing "adb shell" and it shows me $
if i am doing adb shell --> $ --> su --> it shows #
Can some1 knows what is the problem?

Set up/run adb on a MAC

Can someone please help me, or point me in the right direction on how to setup and run simple commands through adb on a MAC? Yes, I've used the search, and yes I've searched all over the internet but I still cannot figure it out. Sorry for my stupidity lol
But any help would be greatly appreciated, thank you
Perhaps you could say a few words about what you have tried already and where you are stopped.
I'm assuming you've downloaded and installed the Mac version of the SDK, yes?
On the phone, you need to turn on Settings -> Applications -> Development -> USB debugging (and may as well check "Stay awake", too).
I don't have a OS/X box, but on Linux you need to perform the *first* adb command as root... the first time an "adb" command is run (after a reboot) it starts up an adb-server process, and that needs to be priviliged enough to write to USB. (After that, you can run adb commands as any user, since those commands "talk" to the adb-server on your Mac, which in turn talks to the phone over the USB cable.)
bftb0
Go to developer. android. com/sdk/index.html (take out the spaces - I still can't post links for some reason) and download the Android SDK for Mac. That same page also includes directions on how to get started with installation. You'll be using the Terminal within Mac OS X for ADB commands, so I would recommend getting comfortable with Terminal before jumping into the SDK. Unfortunately, you'll have to look this up because I couldn't even begin to explain everything, nor do I have the time. Hope the rest helps, though.
bftb0 said:
Perhaps you could say a few words about what you have tried already and where you are stopped.
I'm assuming you've downloaded and installed the Mac version of the SDK, yes?
On the phone, you need to turn on Settings -> Applications -> Development -> USB debugging (and may as well check "Stay awake", too).
I don't have a OS/X box, but on Linux you need to perform the *first* adb command as root... the first time an "adb" command is run (after a reboot) it starts up an adb-server process, and that needs to be priviliged enough to write to USB. (After that, you can run adb commands as any user, since those commands "talk" to the adb-server on your Mac, which in turn talks to the phone over the USB cable.)
bftb0
Click to expand...
Click to collapse
Yes I've downloaded and installed the sdk, turned debugging on and now im trying to flash the recovery image onto my phone and that is where im lost at because I don't know exactly what to do
Los-O said:
Yes I've downloaded and installed the sdk, turned debugging on and now im trying to flash the recovery image onto my phone and that is where im lost at because I don't know exactly what to do
Click to expand...
Click to collapse
Note that what you are asking (now) is completely different than what you asked about in your OP - in fact, OS X is immaterial, really, in light of what you just indicated. That suggests that you are in a hurry... if that is the case, I recommend you spend a couple days reading before you rush off and do something you might regret. It is evident from your response that you really have not been reading the threads here with much diligence.
If you are trying to flash a recovery image, that implies that your phone is already rooted; either that what you are trying it isn't going to work - you have to have a rooted phone to begin with before you flash a custom recovery image. At the moment, you can root your Eris only if it has a 1.5 (1.16.605.1 or 1.17.605.1) official Verizon/HTC release on it. This has been described if not a hundred times in the threads here, at least tens of times - you need to read some more.
Nevertheless, if you want to rush into something, here is a step by step set of instructions which was current a couple of days ago. I won't vouch for it being 100% up to date with the latest and greatest images (either ROM or recovery), but it completely describes the process involved.
Stock 1.5 --> Root (2.1) install --> Custom Recovery install -> recovery to custom ROM 0.3. That's what is working at the moment.
bftb0
bftb0 said:
Note that what you are asking (now) is completely different than what you asked about in your OP - in fact, OS X is immaterial, really, in light of what you just indicated. That suggests that you are in a hurry... if that is the case, I recommend you spend a couple days reading before you rush off and do something you might regret. It is evident from your response that you really have not been reading the threads here with much diligence.
If you are trying to flash a recovery image, that implies that your phone is already rooted; either that what you are trying it isn't going to work - you have to have a rooted phone to begin with before you flash a custom recovery image. At the moment, you can root your Eris only if it has a 1.5 (1.16.605.1 or 1.17.605.1) official Verizon/HTC release on it. This has been described if not a hundred times in the threads here, at least tens of times - you need to read some more.
Stock 1.5 --> Root (2.1) install --> Custom Recovery install -> recovery to custom ROM 0.3. That's what is working at the moment.
bftb0
Click to expand...
Click to collapse
I've already rooted my phone
Los-O said:
I've already rooted my phone
Click to expand...
Click to collapse
Well, then you should be on your way; the instructions for what you are trying to attempt are in that link I provided for you in answer to your question (which you purposely redacted when you quoted my post).
I understand that it's your first post, and I should give some leeway for that reason alone, especially since you might have gotten root without ever having used "adb" or "fastboot". (PB00IMG.ZIP method).
On the other hand, I think you can see my point. Please try to avoid wasting other people's time by providing them useful & relevant details of your situation so they can give you good answers. And reading some of the links adjacent to your own post which actually give exactly the details you are asking for might be a good idea, too.
You wanted to know "What are the directions to DisneyWorld?", but instead asked "How do I put gas in my car?" - when you already knew exactly how to do that. But don't take my word for it - reread your first post for yourself - it actually says nothing about what you are trying to do.
I don't know, maybe I got this all wrong, and you still don't have your phone talking to your OS X machine correctly with adb, and that's the source of the trouble. But then, there would be no way to know one way or another - you haven't really said.
bftb0
Download the android sdk and run this automator script.
20 Questions
Los-O:
You said "any help would be greatly appreciated." Maybe that will also include help from the surly folks, such as me.
You said you have "downloaded and installed the SDK". Let's start there. (Also, note that the Android SDK for Mac OS X is only for x86 Apple machines - stop right here if you are using an older PPC based OS X machine).
The Mac SDK is in a .zip file. I presume that means that you unzipped it somewhere on your hard drive, and that you can remember what the folder name/directory name is where you unpacked all those files. (From where I sit, that could mean that you used a GUI based tool, or something from the command line to unpack the files; but I am guessing.)
Here is a flowchart to help you with the steps.
(1) Have you successfully run the "adb" command from within a Terminal window? (Yes: goto (4), No: Continue)
(2) Do you know how to open a Terminal window in OS X? (Yes: goto (4), No: Continue)
(3) Have a look at this information about Terminal on OS X, and then
(4) Start a Terminal window up.
(5) When you type the command (followed by hitting the Enter key):
Code:
adb --help
at the command line, do you get a pageful of information about the adb command, or an error such as "command not found"? (Help Info: goto step (7), No: Continue)
(6) Add to your PATH the location of the SDK tools (including "adb"). For this step, you need to recall where you unpacked your .zip file. On my Linux box, the "adb" command (and others) are located in the folder at
/opt/android/android-sdk_r05-linux_86/tools/
where the part "/opt/android/" is the folder I unzipped them in. For OS X, surely the next folder name in the path is something other than "android-sdk-linux_86" - just poke around in whatever OS X uses as a file browser, and look for the "tools" folder underneath where you unpacked the files. Once you have done that, you should be able to type the full "path" to that (tools) folder in a command.
Let's suppose that the complete path to that "tools" folder looks something like this:
/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Then, for example, we would add this to the current terminal (shell) PATH using the following command:
Code:
export PATH=${PATH}:/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Obviously, you would change the part "HardDrive...86" so it matches the complete path to the "tools" folder in the SDK which you unpacked onto your machine.
You can inspect the value of PATH for correctness by typing the command
Code:
echo $PATH
Now, go back to step (5) and keep at steps 5-6 until you are able to run the "adb --help" command successfully - that is, get it to print some help information. Don't close this Terminal window after you have the PATH set correctly - we are going to use it shortly.***
(7) Plug the phone into the USB cable and the USB cable into the computer
(8) On the phone, make sure that Settings -> Applications -> Development -> USB debugging is toggled on.
(9) In the terminal window from step (6), type the commands
Code:
adb kill-server
adb devices
You will see one of three things at this point after the "adb devices" command executes:
A. (this is what we want to see)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT9ABCDnnnnn device
If you see this, very good: adb has detected your phone and talked to it; continue to step # (10).
B. (not good - you probably need to run adb as the root user)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
???????????? no permissions
In this case, the "adb" command ran, and detected the presence of the phone, but does not have sufficient privileges to write to the USB device; whether or not this happens in a given flavor or Unix (e.g. OS X) depends on what user and group permissions are set on the device, and which "groups" regular users are in. Not having OS X in front of me, I can not predict; but the solution in this case is to run the command as the root user.
It is my impression that OS X has the "sudo" command for this purpose (read here); if that is the case, then you might want to run the commands
Code:
adb kill-server
sudo `which adb` devices
If sudo is not available to you, or not setup correctly, you might have to read this Apple Technical Note, or this one, or this one
C. (some other problem - no USB device is detected)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
Your on your own for this one - consult your local Apple OS X expert!
(10) Now you are ready to communicate with the phone using "adb" commands.
Note that running the "adb" command for the first time after your OS X machine is booted up creates a long lived adb "server" process. (You might see it in a "ps" command listing as "adb fork-server"). That process is what actually communicates with the phone. Any subsequent "adb" command first communicates with that "adb server" on your OS X machine, and then the server communicates with the phone.
Sometimes it goes stale or gets cranky after unplugging the phone too many times. Simply re-start if you want by doing a "adb kill-server" (any user can do this), followed by any adb command, keeping in mind the results from step # (9) above.
OK, whew! The desired goal was to get a recovery image loaded on to the Eris after it had been rooted - it is time to do that, as adb is working now.
See the Instructions by GrdLock here, in the section entitled "II. Installing Amon's recovery image"
bftb0
***The setting of the PATH when you use the Terminal app using the directions given in step # (6) only last for the life of a single Terminal session. If you want to make this change in such a way that it will be already set up every time you open a new Terminal window, you need to do this by editing a file in your home folder - either ".bash_profile" or ".bashrc" . (Different files names are used depending on which "shell" is used). Setting this up is an exercise left up to the interested reader.
Once you have the android sdk unzipped, add the full path to the android tools directory to your path.
I just added the path to my .bash_profile.
For me it looks like this:
export ANDROID-SDK=/Users/Aaron/android-sdk/
export PATH=$ANDROID-SDK/toolsATH
Then I save and close my bash_profile and run the command, from the terminal:
source .bash_profile
This reloads the bash_profile into the shell. Then cd to your android tools directory. Once you get into the tools directory type the command adb. If everything is correct you should see a help menu spit out to the console.
If you need help with your bash_profile a simple google search will help you out.
hey bftb0,
just wanted to chime in and say thanks for that step-by-step. been wrestling with the same issues as the original poster and your walk through got it going. thanks for being patient.
taocow
bftb0,
thank you so so soo much for that last post, I think i've finally figured it out. and also thank you for your patience, i wish i could buy you a coke or something lol
taocow said:
hey bftb0,
just wanted to chime in and say thanks for that step-by-step. been wrestling with the same issues as the original poster and your walk through got it going. thanks for being patient.
taocow
Click to expand...
Click to collapse
los-O said:
bftb0,
thank you so so soo much for that last post, I think i've finally figured it out. and also thank you for your patience, i wish i could buy you a coke or something lol
Click to expand...
Click to collapse
taocow / los-O
Did you need to run the first "adb" command as root with "sudo" ? Let me know - and also mention the version of OS X that you are using; maybe it will help other Mac users if they read this thread. (I got the impression from reading a little bit that different releases of OS X might handle "sudo" a little differently - or have different device permissions for regular users.)
Also, in reviewing this thread, I have to say ... I acted like an a$$. And I should know better, I did IT for a while. If there is one thing I learned about dealing with people and computers, it's that it is extremely easy for a misunderstanding to occur, and especially if you are helping someone out over the phone or via mail/forum. Please accept my apologies.
bftb0
bftb0 said:
taocow / los-O
Did you need to run the first "adb" command as root with "sudo" ? Let me know - and also mention the version of OS X that you are using; maybe it will help other Mac users if they read this thread. (I got the impression from reading a little bit that different releases of OS X might handle "sudo" a little differently - or have different device permissions for regular users.)
Also, in reviewing this thread, I have to say ... I acted like an a$$. And I should know better, I did IT for a while. If there is one thing I learned about dealing with people and computers, it's that it is extremely easy for a misunderstanding to occur, and especially if you are helping someone out over the phone or via mail/forum. Please accept my apologies.
bftb0
Click to expand...
Click to collapse
also now im able to install the recovery (thanks to you) but when i try and push the recovery and flash images i get
"cannot stat 'recovery.img': No such file or directory" same for the flash image
but i put the files in the tools folder like the guide said to do...?
also im on OS X 10.6.2, but no i didnt have to use the "sudo" thing you were talking about, the "adb devices" command worked the first try. and dont worry about it, i understand where you were coming from. but apology accepted, though
Los-O said:
also now im able to install the recovery (thanks to you) but when i try and push the recovery and flash images i get "cannot stat 'recovery.img': No such file or directory" same for the flash image but i put the files in the tools folder like the guide said to do...?
Click to expand...
Click to collapse
That sounds like you are referring to the files by name, but they are not in the current directory where you are running the fastboot command.
The "pwd" command (Print Working Directory) tells you what your current directory is.
The "cd folder-path" command (Change Directory) allows you to change the Terminal/Shell's idea of where the "current directory" is.
The idea behind the PATH variable is that it is a searchable list (separated by ':' colon characters), so that you can be in a given directory with the files you want to manipulate, but the commands you use are in other directories. When you start a command by typing its' name, the Terminal/Shell app walks through that list of folders in PATH (from left to right in order), looking for that program by name.
That means that if you want to run a program ("proggie") that opens a file ("myfile") that is in the current directory you might type the command.
$ proggie myfile
(or $ proggie ./myfile )
... and as long as "proggie" was in one of the folders listed in your PATH, it would run, and find your file "myfile".
But, there is no requirement that you be in the same directory with your files, or the program that you are running (for instance "fastboot"). In those cases, you need to explicitly specify the complete path to your files or programs, so they can be found. For instance:
$ proggie /users/los-o/mystuff/project3/myfile
or, if "proggie" was not in a folder in your PATH, but you knew that it was located in /opt/tools, you could type the command
$ /opt/tools/proggie myfile
If your current directory contains the file "myfile", or
$ /opt/tools/proggie /users/los-o/mystuff/project/myfile.
Same deal with fastboot - you give it the name of the recovery file as the 3rd argument on the "command line"
$ fastboot flash recovery name-of-my-copy-of-the-recovery-file.img
bftb0
*Whew!* Ok thanks again bftb0 for all the help, I think im finally starting to get the hang of this adb stuff
u have a knack for teaching
bftb0 said:
Los-O:
You said "any help would be greatly appreciated." Maybe that will also include help from the surly folks, such as me.
You said you have "downloaded and installed the SDK". Let's start there. (Also, note that the Android SDK for Mac OS X is only for x86 Apple machines - stop right here if you are using an older PPC based OS X machine).
The Mac SDK is in a .zip file. I presume that means that you unzipped it somewhere on your hard drive, and that you can remember what the folder name/directory name is where you unpacked all those files. (From where I sit, that could mean that you used a GUI based tool, or something from the command line to unpack the files; but I am guessing.)
Here is a flowchart to help you with the steps.
(1) Have you successfully run the "adb" command from within a Terminal window? (Yes: goto (4), No: Continue)
(2) Do you know how to open a Terminal window in OS X? (Yes: goto (4), No: Continue)
(3) Have a look at this information about Terminal on OS X, and then
(4) Start a Terminal window up.
(5) When you type the command (followed by hitting the Enter key):
Code:
adb --help
at the command line, do you get a pageful of information about the adb command, or an error such as "command not found"? (Help Info: goto step (7), No: Continue)
(6) Add to your PATH the location of the SDK tools (including "adb"). For this step, you need to recall where you unpacked your .zip file. On my Linux box, the "adb" command (and others) are located in the folder at
/opt/android/android-sdk_r05-linux_86/tools/
where the part "/opt/android/" is the folder I unzipped them in. For OS X, surely the next folder name in the path is something other than "android-sdk-linux_86" - just poke around in whatever OS X uses as a file browser, and look for the "tools" folder underneath where you unpacked the files. Once you have done that, you should be able to type the full "path" to that (tools) folder in a command.
Let's suppose that the complete path to that "tools" folder looks something like this:
/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Then, for example, we would add this to the current terminal (shell) PATH using the following command:
Code:
export PATH=${PATH}:/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Obviously, you would change the part "HardDrive...86" so it matches the complete path to the "tools" folder in the SDK which you unpacked onto your machine.
You can inspect the value of PATH for correctness by typing the command
Code:
echo $PATH
Now, go back to step (5) and keep at steps 5-6 until you are able to run the "adb --help" command successfully - that is, get it to print some help information. Don't close this Terminal window after you have the PATH set correctly - we are going to use it shortly.***
(7) Plug the phone into the USB cable and the USB cable into the computer
(8) On the phone, make sure that Settings -> Applications -> Development -> USB debugging is toggled on.
(9) In the terminal window from step (6), type the commands
Code:
adb kill-server
adb devices
You will see one of three things at this point after the "adb devices" command executes:
A. (this is what we want to see)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT9ABCDnnnnn device
If you see this, very good: adb has detected your phone and talked to it; continue to step # (10).
B. (not good - you probably need to run adb as the root user)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
???????????? no permissions
In this case, the "adb" command ran, and detected the presence of the phone, but does not have sufficient privileges to write to the USB device; whether or not this happens in a given flavor or Unix (e.g. OS X) depends on what user and group permissions are set on the device, and which "groups" regular users are in. Not having OS X in front of me, I can not predict; but the solution in this case is to run the command as the root user.
It is my impression that OS X has the "sudo" command for this purpose (read here); if that is the case, then you might want to run the commands
Code:
adb kill-server
sudo `which adb` devices
If sudo is not available to you, or not setup correctly, you might have to read this Apple Technical Note, or this one, or this one
C. (some other problem - no USB device is detected)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
Your on your own for this one - consult your local Apple OS X expert!
(10) Now you are ready to communicate with the phone using "adb" commands.
Note that running the "adb" command for the first time after your OS X machine is booted up creates a long lived adb "server" process. (You might see it in a "ps" command listing as "adb fork-server"). That process is what actually communicates with the phone. Any subsequent "adb" command first communicates with that "adb server" on your OS X machine, and then the server communicates with the phone.
Sometimes it goes stale or gets cranky after unplugging the phone too many times. Simply re-start if you want by doing a "adb kill-server" (any user can do this), followed by any adb command, keeping in mind the results from step # (9) above.
OK, whew! The desired goal was to get a recovery image loaded on to the Eris after it had been rooted - it is time to do that, as adb is working now.
See the Instructions by GrdLock here, in the section entitled "II. Installing Amon's recovery image"
bftb0
***The setting of the PATH when you use the Terminal app using the directions given in step # (6) only last for the life of a single Terminal session. If you want to make this change in such a way that it will be already set up every time you open a new Terminal window, you need to do this by editing a file in your home folder - either ".bash_profile" or ".bashrc" . (Different files names are used depending on which "shell" is used). Setting this up is an exercise left up to the interested reader.
Click to expand...
Click to collapse
excellent post...very helpful
Los-O said:
Can someone please help me, or point me in the right direction on how to setup and run simple commands through adb on a MAC? Yes, I've used the search, and yes I've searched all over the internet but I still cannot figure it out. Sorry for my stupidity lol
But any help would be greatly appreciated, thank you
Click to expand...
Click to collapse
I do everything on a Mac, so I would be the guy to ask. How far did you get? Have you unzipped the sdk to a folder?
Basically the difference between mac and others is that when others do a command like adb, we have to do ./adb This is true for other commands too. It's easy once you get used to it.
bftb0,
Thanks so much! Step 6 solved my problem
Thank you!!
bftb0 said:
Los-O:
You said "any help would be greatly appreciated." Maybe that will also include help from the surly folks, such as me.
You said you have "downloaded and installed the SDK". Let's start there. (Also, note that the Android SDK for Mac OS X is only for x86 Apple machines - stop right here if you are using an older PPC based OS X machine).
The Mac SDK is in a .zip file. I presume that means that you unzipped it somewhere on your hard drive, and that you can remember what the folder name/directory name is where you unpacked all those files. (From where I sit, that could mean that you used a GUI based tool, or something from the command line to unpack the files; but I am guessing.)
Here is a flowchart to help you with the steps.
(1) Have you successfully run the "adb" command from within a Terminal window? (Yes: goto (4), No: Continue)
(2) Do you know how to open a Terminal window in OS X? (Yes: goto (4), No: Continue)
(3) Have a look at this information about Terminal on OS X, and then
(4) Start a Terminal window up.
(5) When you type the command (followed by hitting the Enter key):
Code:
adb --help
at the command line, do you get a pageful of information about the adb command, or an error such as "command not found"? (Help Info: goto step (7), No: Continue)
(6) Add to your PATH the location of the SDK tools (including "adb"). For this step, you need to recall where you unpacked your .zip file. On my Linux box, the "adb" command (and others) are located in the folder at
/opt/android/android-sdk_r05-linux_86/tools/
where the part "/opt/android/" is the folder I unzipped them in. For OS X, surely the next folder name in the path is something other than "android-sdk-linux_86" - just poke around in whatever OS X uses as a file browser, and look for the "tools" folder underneath where you unpacked the files. Once you have done that, you should be able to type the full "path" to that (tools) folder in a command.
Let's suppose that the complete path to that "tools" folder looks something like this:
/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Then, for example, we would add this to the current terminal (shell) PATH using the following command:
Code:
export PATH=${PATH}:/HardDrive1/foo/bar/android-sdk_r05-mac_86/tools
Obviously, you would change the part "HardDrive...86" so it matches the complete path to the "tools" folder in the SDK which you unpacked onto your machine.
You can inspect the value of PATH for correctness by typing the command
Code:
echo $PATH
Now, go back to step (5) and keep at steps 5-6 until you are able to run the "adb --help" command successfully - that is, get it to print some help information. Don't close this Terminal window after you have the PATH set correctly - we are going to use it shortly.***
(7) Plug the phone into the USB cable and the USB cable into the computer
(8) On the phone, make sure that Settings -> Applications -> Development -> USB debugging is toggled on.
(9) In the terminal window from step (6), type the commands
Code:
adb kill-server
adb devices
You will see one of three things at this point after the "adb devices" command executes:
A. (this is what we want to see)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT9ABCDnnnnn device
If you see this, very good: adb has detected your phone and talked to it; continue to step # (10).
B. (not good - you probably need to run adb as the root user)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
???????????? no permissions
In this case, the "adb" command ran, and detected the presence of the phone, but does not have sufficient privileges to write to the USB device; whether or not this happens in a given flavor or Unix (e.g. OS X) depends on what user and group permissions are set on the device, and which "groups" regular users are in. Not having OS X in front of me, I can not predict; but the solution in this case is to run the command as the root user.
It is my impression that OS X has the "sudo" command for this purpose (read here); if that is the case, then you might want to run the commands
Code:
adb kill-server
sudo `which adb` devices
If sudo is not available to you, or not setup correctly, you might have to read this Apple Technical Note, or this one, or this one
C. (some other problem - no USB device is detected)
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
Your on your own for this one - consult your local Apple OS X expert!
(10) Now you are ready to communicate with the phone using "adb" commands.
Note that running the "adb" command for the first time after your OS X machine is booted up creates a long lived adb "server" process. (You might see it in a "ps" command listing as "adb fork-server"). That process is what actually communicates with the phone. Any subsequent "adb" command first communicates with that "adb server" on your OS X machine, and then the server communicates with the phone.
Sometimes it goes stale or gets cranky after unplugging the phone too many times. Simply re-start if you want by doing a "adb kill-server" (any user can do this), followed by any adb command, keeping in mind the results from step # (9) above.
OK, whew! The desired goal was to get a recovery image loaded on to the Eris after it had been rooted - it is time to do that, as adb is working now.
See the Instructions by GrdLock here, in the section entitled "II. Installing Amon's recovery image"
bftb0
***The setting of the PATH when you use the Terminal app using the directions given in step # (6) only last for the life of a single Terminal session. If you want to make this change in such a way that it will be already set up every time you open a new Terminal window, you need to do this by editing a file in your home folder - either ".bash_profile" or ".bashrc" . (Different files names are used depending on which "shell" is used). Setting this up is an exercise left up to the interested reader.
Click to expand...
Click to collapse
Wow what a straightforward guide to helping me get this set up!! A million thanks! I don't even have an Eris, but what model of the phone you have is irrevelant to this guide...
Thanks again!!

how to disable light sensor in stock rom

this light sensor is really pissing me off , is there any way to shut it off , i'v found a way that is telling me to chmod 777 the patch file after installing it manually but idon't know what chmod 777 is and how to do this please help me
Is stock eclair there isn't a GUI option to disable it.
About chmod 777, I haven't done it yet... but I guess you have to adb shell something.
To know how to use those commands, just have a click on the search button...
maveloth said:
Is stock eclair there isn't a GUI option to disable it.
About chmod 777, I haven't done it yet... but I guess you have to adb shell something.
To know how to use those commands, just have a click on the search button...
Click to expand...
Click to collapse
i searched and found nothing please help it's pissing me off for real !! se u suck i bought this phone because of it's design but their software update service sux !
I have found what you were looking for [just search in devs forum].
Here it is an explaining link:
http://forum.xda-developers.com/showthread.php?t=888232
maveloth said:
I have found what you were looking for [just search in devs forum].
Here it is an explaining link:
http://forum.xda-developers.com/showthread.php?t=888232
Click to expand...
Click to collapse
thanks i found this thread before but i can't apply this method because i don't know how to chmod777 the file so i can't get this to work ? can you try it and then tell me how to exactly do it please , thanks again m8
First thing, you have to learn how to adb shell.
But you have to make everything ok before using it.
So, let's see how it has to be done..
Download the .zip file posted on the other thread [linked above].
Using root explorer, just copy and paste the content of the .zip file under the /etc/ path of the phone.
After you have done this, let's adb shell.
1. Download this file: http://db.tt/cq44S4v
2. Extract the adb.zip file to C:\adb [there will be a folder named "adb" within the C:\ path, with 3 files within it].
3. On your phone, click Settings > Applications > Development, and make sure USB Debugging is on.
4. Plug your phone into your computer via USB cable [it needs to be on]. It should say installing drivers if your phone is plugged for the first time and you are using Windows.
4.1 You'd better install the drivers which comes with X8 software [PC Companion], or just google for them.
5. After it installs the drivers, go to the Start menu and type "cmd" into the search bar to open the command prompt.
6. Type the following into the command prompt window [hitting enter at the end of every line]:
Code:
cd\
cd adb
adb devices
You should see a serial number pop up, it’s the serial number of your phone. This means you are all set.
After all this procedure, you can finally "chmod" your files.
Always from the CMD, type this:
Code:
adb shell
You should see a "#" on the left. That's good.
Now enter the path with the file to chmod:
Code:
cd /etc
Then finally chmod it:
Code:
su chmod 777 hw_config.sh
You're done.
Hope this helps.
maveloth said:
First thing, you have to learn how to adb shell.
But you have to make everything ok before using it.
So, let's see how it has to be done..
Download the .zip file posted on the other thread [linked above].
Using root explorer, just copy and paste the content of the .zip file under the /etc/ path of the phone.
After you have done this, let's adb shell.
1. Download this file: http://db.tt/cq44S4v
2. Extract the adb.zip file to C:\adb [there will be a folder named "adb" within the C:\ path, with 3 files within it].
3. On your phone, click Settings > Applications > Development, and make sure USB Debugging is on.
4. Plug your phone into your computer via USB cable [it needs to be on]. It should say installing drivers if your phone is plugged for the first time and you are using Windows.
4.1 You'd better install the drivers which comes with X8 software [PC Companion], or just google for them.
5. After it installs the drivers, go to the Start menu and type "cmd" into the search bar to open the command prompt.
6. Type the following into the command prompt window [hitting enter at the end of every line]:
Code:
cd\
cd adb
adb devices
You should see a serial number pop up, it’s the serial number of your phone. This means you are all set.
After all this procedure, you can finally "chmod" your files.
Always from the CMD, type this:
Code:
adb shell
You should see a "#" on the left. That's good.
Now enter the path with the file to chmod:
Code:
cd /etc
Then finally chmod it:
Code:
su chmod 777 hw_config.sh
You're done.
Hope this helps.
Click to expand...
Click to collapse
lol it's freaking hard , thanks for your help m8 i appreciate it is there any easier way?
Have you tried installing Spare Parts from the market. I know it has light sensor tweak option plus has tons of other useful tweaks and monitors.
Sent from my I7500 using Tapatalk
Master Darko said:
Have you tried installing Spare Parts from the market. I know it has light sensor tweak option plus has tons of other useful tweaks and monitors.
Sent from my I7500 using Tapatalk
Click to expand...
Click to collapse
tried it still no use , the sensor is still working !!

[adb] [Ubuntu] [script] Quick ADB restart as root script

Hello all. I created a quick fix for a minor annoyance when using ADB on Ubuntu. It seems that at every reboot the adb server would not start as root and as a result i would end up with an error having to do with insufficient privileges when trying to run an adb command.
I created a fix; this might not be the right way to go so i'm open to suggestions, but so far it works for me.
I created a script to quickly restart the ADB server as root.
The script contains the following commands
adb kill-server
cd android-sdk-linux_x86/platform-tools
sudo ./adb start-server
adb devices
Notes:
1. If adb is located somewhere else on your computer, modify the 2nd line to match that location.
2. It will ask you to elevate your privileges when you run it.
3. I placed the script in my home folder and gave it executable permissions so that i could run it by simply typing "./adbrestart" without the quotes from a freshly opened terminal. I recommend unzipping this into your home folder for that reason
Again, this is just a method that works well for me, if someone has a better method of doing this, please feel free to chime in.

[Q] Mac OSX - ADB - List of devices attached Blank

I am running on a Mac (OSX Lion) and have installed android-sdk-macosx.
I am trying to connect to a Kindle Fire 6.2.2
However, this is as far as I can get:
Code:
bash-3.2# ./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
bash-3.2#
As you can see, no devices show up.
I have tried switching cables, USB ports, reboot the device and my machine... banging my head against the wall.
Nothing works.
I have read about 29 pages of posts through this forum, and Googled it.
No dice.
Any suggestions?
would not use the sdk at all - if you use the mac/linux version of kfu you save a lot of time and space - you don't need to use kfu if you don't like to - but all commands you'll ever need are in the tools folder of kfu - it also includes drivers and setup scripts - maybe give it a try:
http://forum.xda-developers.com/showpost.php?p=21369040&postcount=653
mkdir ~/.android
echo 0x1949 >> ~/.android/adb_usb.ini
ADB needs this entry to see the Kindle Fire no matter what OS you're on.
right - there is also a installation script for this included in the pack - install.sh if i remember right
took the advice above and it's still not working for me. i have the same exact problem. when i try to run install_drivers.sh i get:
cp: drivers/adb_usb.ini: No such file or directory
Done!
logout
[Process completed]
When I run KFU i get:
/Users/donaldclark/kfu/run.sh: line 84: seq: command not found
please help
as far as i know (don't own a mac) you have to call the commands with
./ from terminal window - eg ./run.sh
I also got the same error message at line 84 running the install script in OSX 10.6.8
-E
it's from eratosthene - give him a pm - i'm shure he can help you
http://forum.xda-developers.com/member.php?u=1616763
Try remove the usb driver from your device and re-install gain.
I use Kindle_Fire_Utility_MacLinux_0.9.2 3 with adb.mac
and its located right inside my root directory (not under users) step before.
I went to the files and I opened file called
install_drivers.sh
I did deleted everything behind -p and just dragged
the adb_usb.ini (its located in drivers) into that install_drivers.sh script and I hit save.
thats how it looks like
mkdir -p /Kindle_Fire_Utility_MacLinux_0.9.2 3/drivers/adb_usb.ini/adb_usb.ini
Than I just run adb.mac and all is operational
my kindle was rooted with burittoroot2
If you need those files send me a pm I have them in my dropbox.
somboonr said:
Try remove the usb driver from your device and re-install gain.
Click to expand...
Click to collapse
there is no uninstalling drivers like in windows.
line 84 SOLUTION
Incarnate609 said:
took the advice above and it's still not working for me. i have the same exact problem. when i try to run install_drivers.sh i get:
cp: drivers/adb_usb.ini: No such file or directory
Done!
logout
[Process completed]
When I run KFU i get:
/Users/donaldclark/kfu/run.sh: line 84: seq: command not found
please help
Click to expand...
Click to collapse
Regarding the "run.sh: line 84: seq: command not found", I found out that the "seq" command is not recognized with MAC OS... so I did a search and replace, replacing "seq" with "jot -". Now it works.
Reference: Search google for seq and mac
What worked for me.
I had the same problem after updated the sdk on my MacBook Mac OSX 10.6.8
cd to the tools directory (where android program is located)
run:
./android update usb
./android update adb
then edit the ~/.android/adb_usb.ini file and add 0x1949 as the last line (your previous adb_usb.ini file is overwritten by the above commands).

Categories

Resources