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 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
I am using Genymotion Emulator with Nexus s and 4.2.2.
Previously i used regular AVD that we can create using Eclipse provided by ANDROID SDK.
In regular AVD we can enable/disable data packet access to internet by using
Settings->Wireless&Networks->Data Enabled
Or by pressing F8 key but i am unable to found it in Genymotion emulator.
Where i can find it?
You cannot do that on Genymotion.
If you want to test what your application will do without internet access, you can unplug your ethernet cable or switch off your Wi-Fi.
It's not the same but could still help to test your app.
I hade this problem.
If you disable the internet and try to debug your app, the app will not be able to connect to vs code debug server.
This what you should do.
1- in your emulator, click Debug/settings and change the ip:port to the following localhost:your port eg 5555
2- disable the wifi and your app will start without internet but still able to connect to vs code
My scenario is as follow:
I'm working with an app development which a bug occurs in the app when it is in a different country than mine, and only there. The bug is related with a fail in an image download through an URL access. Right now, I haven't figured out yet what it can be. Some subjects I've already looked up are:
Its not related to internationalization and/or culture, because the code does not implement this;
Its not related to firewall/security access, because if the user in the other country opens the image's URL, he can look at the image;
Without rooting the device, is there is a way to remotely open and debug a given Android device, just like a SSH or a VNC?
Similar questions are:
Debugging android app on a device remotely
Remote Debugging
Well,
you can debug a device using a TCP/IP connection (I sometimes debug using WIFI at home). all you need to do is make sure the remote device is connected to the internet and is accessible to your PC with a direct TCP/IP connection.
As the Android device is connected in another location - you'll have to make sure your router's firewall allows outgoing connection for communications in the port ADB is using , and that the target Android device receives communications in that port (if it's behind a router - the router should allow connections under the righ port and forward all comm in that port to the android device).
in other words - you have to "tunnel" your communication to the target device. there are other tunneling solutions/products but I've never used them and I prefer the "manual" way
Good luck,
Dan
EDIT : in Android 11 - adb can work on WIFI natively : https://developer.android.com/studio/run/device#wireless
Perhaps you can have the user install something like aLogcat and have them send you a log with the failure.
Well as remotely debugging a device I don't know but you can use ACRA (Application Crash Report for Android) .
All you need is to set up a google doc, add the lib to your project and when the app crashes it will send a crash report to that google doc. See quick setup here
I need network connection on my Android device to test apps. My notebook WiFi adapter is broken, so after 2 hours I've set connection via USB. But! Eclipse doesn't see the device when I start "Wired Tether" on it to get connection and I can't debug my apps.
Does anybody know how to solve this issue? Use USB tethering to get internet connection on phone and debug apps at the same time?
I don't know of a way to simultaneously use USB debugging and tethering. Here are some workarounds, though:
Get a USB wireless adapter for your computer (see http://www.amazon.com/gp/bestsellers/electronics/13983791/ref=pd_zg_hrsr_e_2_4_last). I don't know if buying one of these is an option for you in India.
Send your apk to your phone wirelessly for app installation (see Developing on android-based device via wireless) and then view the logcat directly on the phone for debugging (aLogcat seems to be popular, and allows you to send log files via, for example, email, so that you can open them on your computer to view them on a bigger screen)
I know these solutions involve some cost, effort, or inconvenience, but hopefully one will work for you.
EDIT:
As noted in answers from #shkschneider and #CodeShane, Internet sharing via Bluetooth is possible. CodeShane's answer mentions PdaNet (which apparently also allows for simultaneous USB tethering and debugging), and includes a link. Another solution is OpenGarden. These solutions provide access to the Internet for the computer via the phone. If the reverse is desired (and this is not entirely clear from the question), reverse tethering seems to be the answer (see the answer from #NickL).
Long story short: you can't. Android simply does not supports it (that is more because of the USB standard and tethering action than AOSP's fault).
So to go around the problem, you should either:
Get internet form another source
Maybe you could have ethernet connection?
Tether internet from your phone to your netbook in another way
You can't use wireless tether since your wifi adapter is broken, but maybe you could tether using bluetooth?
Debug your phone in another way
Maybe you could use an android application like aLogCat or similar?
But in the hand, sorry, you can't tether usb from phone to netbook while usb debugging from the netbook. Your success will depend on your ability to find an alternative solution.
I would like to point out that I am using PDANet for USB-tethered internet to type this reply while I am also debugging an android application on the same phone via Eclipse Juno. Not sure which side fixed this, but it is awesome!
As for why Eclipse isn't seeing your device, standard troubleshooting tips apply .. make sure to enable USB debugging and unknown sources/3rd party apps, try restarting, check usb drivers, update drivers/eclipse..
Device not detected in Eclipse when connected with USB cable
http://developer.android.com/tools/device.html
Eclipse not finding phone
PdaNet 3.5
Eclipse Juno Service Release 1; Build id: 20120920-0800
You can use bluetooth tethering to get internet connection and debug using USB.
Step 1. Turn off USB tethering
Step 2. Turn on Wireless USB Debugging
Connect to your device via USB
Enter "adb tcpip 5555"
Unplug your device
Look up your device's IP in the system settings
Enter "adb connect [ip address]:5555"
Step 3. Turn on USB tethering
Now you can use internet via USB cable and debug app in wireless mode
That's it!
Yes, its possible. There's a hack available at below links !
Source: HowToGeek , StackOverFlow
You can actually connect the adb to the phone via TCP. You may need a rooted phone for this to work, though
If I understand your question correctly, you want to tether your phone to the PC via USB, and use the (internet)connection of your PC + still get logcat output?
Then yes, this certainly is possible.Tethering is when your PC uses the internet of your phone, the other way around is called reverse tethering. Your device has to be rooted, then you can use this application for reverse tethering.
When you connect your phone to the computer via USB, you press 'connect' in the application. It then installs an app on your phone, which handles the reverse tethering connection. It works, I sometimes have to press 'check DNS' while it is connecting to make it working.. but it works! Also debugging via USB works the usual way.
First you need to debug your device using USB cable then type adb tcpip 5555 it will allow debugging via TCP/IP protocol.
After that turn on your USB tethering, now your computer get internet connection but lost the USB debugging.
Now you must know your phone IP address so you can debug via TCP/IP. You can use command arp -a in terminal and look at the gateway address.
The last is connect to your phone using adb connect yourphoneip:5555 for example adb connect 192.168.42.129:5555
Now you get debug and tether at the same time
You can use
WiFi Tethering - For Internet connection
Connect USB for adb.