"Allow USB debugging?" keeps popping up - android

I'm going nuts here. I am trying to debug my app on a Samsung Galaxy Tab S5e.
My application runs a VPNService and I am reasonably sure this is the root cause of the following issue:
When debugging via USB, everything works fine. However, when I debug over WIFI, it keeps prompting me to "Allow USB debugging", saying something about the computers RSA key fingerprint and whether I want to "always allow from this computer", which I obviously select and then click "allow".
If I try debug my app again, it will again prompt me...
I've tried:
restarting the device.
killing adb and starting it again
restarting my machine (Macbook Pro)
revoking all USB debugging authorisations
deleting the adbkey.pub and adbkey files
FACTORY RESET OF DEVICE
Nothing works.
Does anyone know how I can solve this? I have to go via wireless because I need to measure energy consumption... which I cannot do if the device is being charged.

Related

how to test an app without a USB cable which attaches the device to the debugger?

I'm new to android studio and have just made a new app, which uses position sensors.
All is well when the device is usb connected to the debugger. When I unplug the cable, the app runs fine and I can wave the device around, going to a different room etc. .
But when the app is restarted without that cable, it is "waiting for debugger", which is a little annoying at that point.
I have seen this https://developer.android.com/studio/run#changing-variant but that way I need to sign the app, and I fail on that.
Is there a way to run the app without signing it, and without that debugger cable?
To be more precise in view of the two answers that suggested wi-fi connections (which I can't verify at the moment because the box running AS doesn't have wf-fi connection).
I want to test the app even without debugging, and test it by changing location, too. So I would have to set up a wi-fi connection that would connect to AS over really long distances.
Instead I just want to tell the app (or the device): forget about the debugger.
This: https://stackoverflow.com/a/56541740/4142984 solved my problem.
For the first time you must need to connect device to the android adb and after that you can remove it and still get connection to the android adb.
you should install Android Wifi ADB
you need to connect first time your device with cable in usb debug mode and by using this plugin you can connect your device on the wifi after that you can remove the cable from the system and you will get connected your device to the Android Studio
Note : make sure your system and mobile device must be connected with the same wifi network.
1.Download android-sdk-platform-tools
2. Add the path to environment variables
3. Connect your phone to usb cable
4. Connect your phone and computer in same network(WiFi)\
Now in cmd
5.adb tcpip 5555
6. adb connect *your_phone_ip*:5555
Now you can unplug the usb cable.

How can I enable USB Debugging and WiFi on a locked phone?

I am on a Android 4.4 'HTC One SV' Phone. I don't know the password and it has asked me for google user and pass, but the wifi is turned off and im not sure if I know the password. USB Debugging is also off and I cant access settings since it is locked.
How can I turn wifi on through ADB with USB Debugging off and no way of accessing phone. ADB is not recognising the phone which I believe is because USB Debugging is off. Please help.
USB Debugging simply can't be enabled via root. Normally OEMs put a bypass such as swiping from the swype symbol to the letter S to open Google Now via Swype Keyboard. Also, this typically means the phone was stolen and the thief used the Recovery menu to format the device.

USB Debugging mode auto authorize

I have LG Optimus L70, the system stopped working suddenly.
The problem was that the bootloader is corrupt, so I have to install a new one.
In order to do that, it would be easier to enable USB debugging mode, but the problem is:
When ever I check USB Debugging the phone vibrates indicating that it is connected to PC, when i go to Device Manager on windows, it showed that the device is connected as Single ADB Interface.
The key problem that the phone's system is corrupt even after hard resetting it, so no pop up is shown, so, no RSA authorizing pop up is shown.
How can I automatically accept RSA? or make my device usable in ADB at least?
I have tried all other posts mentioned here in stackoverflow, but non of them seems to solve the problem.
Settings -> Developer -> Revoke authorizations usb debugging

How to store all the android applications to the SD Card by default

I am trying out this adb shell procedure to store all my android apps to the SD Card on my new samsung galaxy tab 4.i have tried the following shell command on my laptop while staying connected with my tab via usb cable and it showed me an error.i am attaching the screenshot here.it keeps on saying "Device Unauthorized".how can i resolve this?
Your device is unauthorized. This means that you either have USB debugging off, or the adb server has messed up.
If you have the USB debugging on, try to revoke the USB debugging and restart the adb server, as suggested in
https://stackoverflow.com/a/25546300/3970830
After connecting the device, you have to accept the connection in the dialog on the device screen.
The error message is giving you the solution. Check your device for a confirmation dialog. It should be asking you to authorize the computer to connect, or something to that effect.

Unable to inspect Android device via Chrome://inspect

I am developing an app for a new Android device (on all other I've never had this issue).
It's running 4.2.2
I have enabled developer mode and allowed usb debugging (I receive the status notification that usb debugging enabled)
However, in chrome://inspect the screen keeps alternating between the below two messages, seems it can't make up it's mind!
ratech72_wet_rlk_lca #0123456789ABCDEF
Offline #00180123456789ABCDEF Pending authentication: please accept debugging session on the device.
I've tried unplugging and restarting everything to no avail
When I plug in the device I see the following status messages on the device systray, in this order
Connected as USB Storage
USB Debugging Connected
USB Connected
How can I access chrome inspect on this device? I am using logcat for now but it's far less powerful than chrome dev tools.
This is a known issue.
The answer in the link (changing USB mode from MTP to PTP) did work for me for some time, however others have had less success, and my setup has now regressed to the erratic connection you are seeing.
Personally, I just try to play quick draw and click on the device when it's listed before it disconnects again, which after a bit of practice doesn't take too long, and once you've done that, the actual inspect tools don't have the same erratic connect/disconnect problem so you should be fine until you physically disconnect the device.
This should be resolved in a future version of Chrome.
I know this is an old question, but nonetheless, this is what helped me:
while in Chrome chrome://inspect/#devices page is opened
turn off USB Debugging,
turn on USB Debugging again
The phone will ask me if I trust the connection...
You will need to check out the Facebook Stetho debugging tool:
http://facebook.github.io/stetho/
It is pretty easy to get up and running. And it works well if you are using OkHttp developed by square to debug networking tools.
add to gradle:
dependencies {
implementation 'com.facebook.stetho:stetho:1.5.0'
}
then in your application class:
Stetho.initializeWithDefaults(this);
and then go to chrome://inspect in your browser and you should see your device
This is what I did in Android 10 (Oneplus 7t pro), to make it to work(in addition to #gordan.sikic answer).
While in Chrome, keep chrome://inspect/#devices page opened
Click and accept, Android Phone -> Settings -> Developer Options -> Revoke USB debugging authorizations
Turn off USB debugging
Turn on USB debugging, accept Allow USB debugging.
Then you 'll see Always allow from this computer Notification
In the virtual Device Manager I selected Wipe Data from the Actions.
Then I started the virtual device.
Then I ran the app and it worked in the emulator.
I found that sometimes I am unable to inspect Android device via Chrome://inspect because I'm in some other country and connecting to US server on both the mobile device and the dev machine via VPN fixes the problem.

Categories

Resources