I am struggling to get past the "Pending Authorization" stage when trying to do some Remote Debugging with my Android phone and Chrome running on my PC.
I have successfully got past this "Pending Authorization" twice now, so I know it is possible. Also my PC can read the files on my phone as well, so the connection between them is sound.
The problem is the pop up on my phone asking for authorization rarely pops up, and when it does, allowing authorization rarely does anything.
These are the steps I have tried - all of this assumes that both my PC and Phone are on, they are not locked and they both have Chrome running on them.
Plug my phone into my PC via a USB cable
Almost immediately a "Use USB to transfer files" pop up appears on my phone, whether I ignore this pop up or tap OK or Cancel seems to make little difference to the problem I am having.
After a short while I then get the "Allow USB Debugging" pop up. In Chrome on my PC I can see under Remote devices that there is an "Unknown" device that is "Pending Authorization".
Ticking the box "Always allow from this computer" makes little difference, and my PC still complains that my device is "Pending Authorization"
If I hit OK what usually happens is very little, the pop up on the phone disappears and my PC/Chrome still shows "Pending Authorization".
Occasionally the phone and my PC connects, and I get past the "Pending Authorization" part. However this doesn't last long and I end up with "Debugging connection was closed. Reason: Connection lost." - however despite it saying "connection lost" here I can still connect to the files on my phone.
To reiterate - the connection between my phone and my PC seems stable and fine, I have no problems transferring files between the two.
The problem I am having is getting past this "Pending Authorization" stage - can anyone help?
Some details:
Phone: Nokia 3
Android: 8.0.0
Chrome (on Phone): 76.0.3809.132
PC: Windows 10
Chrome (on PC): 76.0.3809.132
You need to turn on usb debugging on your phone, otherwise you can not connect to your device. You can turn on usb debugging through the Developer options on your device.
Developer options is also something your have to turn on. You can accomplish this by following the steps explained on this page:
https://developer.android.com/studio/debug/dev-options
When I toggle on the install via USB in developer mode:
it will pop the toast message said that the device is temporarily restricted
then toggle off the settings.
Is there any solution for this?
I searched through all the way like turning off MIUI optimization but still does not work. I cannot debug my application by Android Studio in this way......
"Install via USB" wont work if your Xiaomi phone is running MIUI 8 or above. Looks like when you try to Enable this option, your phone trys to connect to some chinese server and fails.
I got a work around and it worked for me. Idea is to connect to Chinese-Shanghai server through VPN. Try the following:
Install PlexVPN from Playstore and login into it. You will get a 24 hr free VPN service.
Select China-Shanghai server and connect.
From developer option in your Xiaomi phone, Enable "Install via USB".
You can then disconnect the VPN and logout from PlexVPN.
Enjoy!!
All you have to do is Turn your Wi-Fi off, turn on mobile data, and then enable the setting for "Install via USB". It'll go through.
Source: http://en.miui.com/thread-544718-1-1.html
For me on a rooted MIUI v.8.5.1 I just need to:
turn off wifi
turn on mobile connection In development options
after doing that both Install via USB and USB debugging started to work.
Try this
Settings -> Additional Settings -> Developer options -> Turn off Miui Optimizations -> Restart
Security -> Permissions -> Gear Icon at top right corner -> Turn On "Install via USB"
Settings -> Additional Settings -> Developer options -> Turn On/Off "USB Debugging" -> Turn On "Install vis USB"
Turning off Wi-Fi and enabling Mobile Data (thank you Xiaomi for wasting my money to enabling mobile data which the last one I didn't have) on Xiaomi 4A did not work for me. Every time I tried to enable Install App Via USB it displayed me "the device is temporarily restricted". So, I found this solution:
Turn on VPN onto your device with these parameters and try again toggle Install from USB:
Server Address: China server from https://www.vpngate.net/en/
IPSec Key: vpn
Username: vpn
Password: vpn
(1) Turn Off your Wi-Fi
(2) Turn On your Mobile Data
(3) Turn On "Install via USB" from Developer Option of your device.
That's all
The Best what I found devices without mobile data in device is to SIGN_OUT from MI_Account in the device and Login Again -> Try to enable USB_Debugging(Security Setting)-> enable INSTALL_VIA_USB
i had same problem with MI Redmi 4a i solved it by ->
first become a developer by clicking on
setting->About phone->MIUI version (7-8 times)
then, setting->additional setting->developer options->USB debugging
Turn on your usb debugging, then in developer options go for last item name is 'Turn on MIUI optimization', turn off this option it will ask for reboot , then reboot device by clicking Turn off & reboot button
after reboot go to Setting->Permissions click on top right menu button Turn on install via USB option
thats it !
These steps worked for me after struggling 1 hour, Not needed to connect to Chinese server.
(1) Turn Off your Wi-Fi
(2) Turn Off your Mobile Data
(3) Turn On "Install via USB" from Developer Option of your device.
4) It will show the Error "No network found"
5) Now Turn On your Mobile Data
6) Again Turn on "Install via USB"
7) it will work, now
Happy!
In MIUI 8.5 it gives the error like you mention while enabling "install via USB", to resolve the error you need to make WIFI off and make mobile data on and then enable the option “Install via USB”. it will work for you.
A detailed blog: http://sforsuresh.in/xiaomi-mi-note-4-install-via-usb-device-temporarily-restricted/
You will need to sign up/sign in for a Mi account before you continue.
1) Extract sim card from your non-Redmi phone. (It should be nano sim. Contact your telecom provider to get one if you have a micro or normal sim).
2) Insert sim card into Redmi phone.
3) Go to Settings -> Additional Settings -> Developer options.
4) Under Debugging, click on 'Install via USB' option.
The phone will enable this.
Remove the sim card.
That's it!! You should now be able to install your apps via USB from Android studio.
Please remember not to disable this option, otherwise, you may need to re-insert your sim card.
PLEASE NOTE: The above steps are guaranteed to work in Xiaomi Redmi 5 phone. Please improve this answer if the steps are different for other models of Xiaomi.
Disable WiFi and switch install via USB on while you are connected through data and under your xiaomi account. It works!
In my case,
I turned on Airplane mode and
turn it off then
turn off Wifi and
turn on mobile data.
Now I can turn on install via USB.
May it helps some one like me.
Please verify your email and phone number in Mi account first then try this:
Settings -> Additional Settings -> Developer options -> Turn off Miui Optimizations -> Restart
Security -> Permissions -> Gear Icon at top right corner -> Turn On "Install via USB"
Settings -> Additional Settings -> Developer options -> Turn On/Off "USB Debugging" -> Turn On "Install vis USB"
Redmi Note 4 (Nougat 7.0, MIUI 9)
For me, options like Turning WiFi off & on, trying on Data Network, or Turning off MIUI Optimization din't work.
Also, the Install via USB never got enabled.
Following steps helped me to install apps via USB
Additional Settings > Developer Options
Here, click on USB Debugging (Security Settings). This will take you through some warning screens. Allow (click on Next/Accept) for all. At the end, it will be enabled.
Now turn on the Install via USB and it gets enabled.
Try to Run the app by connecting your device. If it still doesn't run (as in my case), find Select USB Configuration and select Charging
This worked for me.
Solution with NO VPNing that worked for me:
go to Settings->Accounts->MiAccount->AccountSecurity->Devices
I had a Redmi 9 device listed there (I don't own a Redmi device)
I removed that Device, so now no devices were listed
go back to developer settings, enable install via USB, everything works.
I assume not everyone will have a Redmi device listed there, maybe some will have a different device, maybe some will even have the correct device(this is not something I can test by myself), but it makes sense to me that correcting any wrong devices from that list (or maybe deleting all devices like I did) might fix the problem.
I got this problem in my Xiaomi Mi5 from India. All the mentioned solutions didn't work in my case. Then I tried to figure out the Core reason behind it and solve it. In MIUI, in order to change "Install via USB" option, you must be connected to the internet and signed in your Mi account. Due to some reason, requests from out of the China servers are getting rejected, so I connected to one open China VPN and tried again to enable 'Install via USB' and I got success. For detailed solution and VPN details, see this useful Youtube video: https://youtu.be/MeKUJlD-Ke4
I will write what worked for me, these other solutions did not work out.
switch "Install via USB" to ON,
When the dialog box "Allowing" appear, quick tap your screen out of the dialog box.
Repeat it until u see that "Install via USB" is ON.
After u see "Install Via USB" is ON, you need to re-checking by pressing back button and go to developer option again.
This worked for me. Thanks.
I had this issue on my Redmi Note 4 with MIUI 9. For me the procedure is very simple.
1. Go to Settings -> Permissions -> Gear icon at top right corner.
2. Give the required permission for Install via USB.
3. Goto Developer Options and try using Install via USB. It will work now.
This process is for one time. I hope you have resolved this issue too.
Faced same problem with Xiaomi Mi5 MUI9.
Turning on/off connections or MUI optimization did not work for me.
What worked is:
Settings -> Additional Settings -> Privacy -> enable Unknown sources
In my case when i updated MIUI version to the new available version, resolved the issue.
So check if there is any update available for your device, go to
Settings => About phone => System update
=> here it will shows you the new available MIUI version for your device. So update it then try again.
Note: Turn your Mobile data before enabling install via USB.
In my case, I connect to Chinese VPN, then I turn on install via USB and its work.
I had the exact same problem, tried all the suggested workarounds, but none of them worked for me. Strangely enough, what actually has worked for me was turning on MIUI optimization (it was turned off when the problem occurred)! After turning it on, I was able to toggle on install via USB.
This worked for me:
Go to settings-> Mi Account->Account security
Then verify phone and email, If not added then add and verify that
I tried everything to no result, then read somewhere that you should use VPN and connect under China to unlock your phone's bootloader. Applied the same solution here and it worked!
If turning your Wi-Fi off is not working for you, then you might have not yet registered your MIUI account as a developer account.
To do so go to MIUI Dev center and register your already created account. After the review process this should not be bugging you anymore.
But remember as other have noted to:
Turn off Wi-Fi connection
Turn on mobile connection
In my case,I was using my phone that is Redmi 4 and the usb debugging was not working.It was always giving the message "the device is temporarily restricted" .I have tried all this steps but the result was same.Then I found the foolish thing that I have put the device in charging mode only.When I switch to MTP(Transfer files) and then it started working correctly.I know its a foolish thing but it may help to someone.
if you have root you can force it with adb shell
adb shell
su
setprop persist.security.adbinput 1
Above solutions doesn't work for me. In my case it works by changing Additional settings -> Region to Russia/Some other country.
For me, on Redmi 3s prime with MIUI 9.2, enabling MIUI optimisation on developer menu worked. It caused phone to restart.
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.