Making android device authorized at new computer - android

The screen of my android device is broken such that it can't be controlled anymore using touch and I'd like to access it via adb on my computer. Fortunately, when it was unbroken I enabled USB debugging. But now I'm using a new computer. On my new computer adb devices tells me that it's unauthorized. When I try to do something with adb I get the error message error: device unauthorized. Please check the confirmation dialog on your device. which I can't do because of the broken screen. But I still have my old computer where the phone is authorized. Is it somehow possible to tell the device via adb at the old computer that the new computer (it's also fine with me to do it for all computers) is allowed to access the device?

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.

Android WiFi ADB plugin not working. Giving error

I installed the Android WiFi ADB plugin to run the app wirelessly. But it's not working it's giving error that Phone and PC should be connected on the same network. I use my phone hotspot to run the internet on my PC. Then I use another phone but then also same error. Someone says it will not work because you use the mobile hotspot for an internet connection on your PC. But when I try to connect another phone then also the same issue. But the same way my friend also does. he also uses the internet using a mobile hotspot but it's working fine on his phone. I have a POCO F1 Phone.
I'm answering this hoping this may help others as well as I find it helpful for my use.
First, Turn on ADB in your phone's developer options. You can search Your_phone_model developer options to find that.
Second, After turning on ADB, Connect your phone with data cable to your laptop/desktop.
Open a Command prompt window, Type adb tcpip 5555, Press allow in adb prompt shown in your phone, it will show restarting adb in tcpip mode. Now, disconnect the USB cable. You can use different port number to connect another device.
Type adb connect your_phone_ip:5555 as for example adb connect 192.168.43.1:5555 in case of hotspot. You can check Phone's IP in WIFI's advanced setting of your phone or in status section.
Now, Everytime your device restarts, repeat steps 3-4.
You can also make a script, just type adb connect your_phone_ip:5555 in a notepad file, save it as name.bat file, right click on it and send to desktop (create shortcut), in the settings on the shortcut, set any shortcut keys. Now, anytime you want to connect, just press the shortcut keys. That's how I do it. You can further open Android studio by this script so it will open Android Studio as well.
Remember, whenever it says Device is Offline, restarts your phone's wifi and reconnect it.

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.

"AdbCommandRejectedException getting properties... device unauthorized" PropertyFetcher issue

I am having trouble running my application on a particular phone. It runs correctly on a different phone and on an emulator. I have the standard unauthorized issue coming up in my ADB logs:
PropertyFetcher: AdbCommandRejectedException getting properties for device [My Device's ID]: device unauthorized. Please check the confirmation dialog on your device.
When I try to run the application anyway on the phone in question, it is able to target the phone and runs the app, but immediately hits a null pointer (that isn't present when running on the other phone or the emulator).
Before you insta-lock this question, I've tried everything in all of the duplicate questions. Specifically
I have set the target to show chooser dialog
I have reset the ADB server
I have revoked and re-accepted permissions, and tried changing the USB type
I have confirmed that Enable ADB Integration is checked
None of which worked.
Furthermore, the same phone was working earlier (not sure what changed), so it's not a bad USB cord.
The phone is a new Nexus 6, and the old phone that works correctly is a Samsung Galaxy S4.
Running adb devices in the android studio terminal shows:
List of devices attached
[My Device's ID] device
Which implies (?) that it is in fact authorized.
You have missed the Fingerprint Certificate Authorization popup in your phone when you connected it. To solve disconnect and plug-in again.Wait for some seconds and a confirmation popup will appear. Click OK.

Eclipse testing my applications on a phone,via usb connection ,on OS X (Yosemite)

So, what I want to do ,is to be able to run my applications from eclipse, directly on my phone.So when I run them, the .apk gets installed and the app runs on my phone, just like it would in a virtual device.
Although, the phone won't show up in my list of "Running Android devices".
I have tried this: http://developer.android.com/tools/device.html -did not work for me ,or perhaps it worked partially but I hit a little bump at the end.When I run the adb devices command, I get this:
List of devices attached
323052d0eae6c0ed unauthorized
Any ideas how to solve this would be highly appreciated!
NOTE: I am trying to do this on a macbook which runs OS X Yosemite.
It's likely that the device is no longer authorized on ADB for whatever reason.
1. Check if authorized:
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d unauthorized
2. Revoke USB Debugging on phone
If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).
3. Restart ADB Server:
Then restarted adb server
adb kill-server
adb start-server
4. Reconnect the device
The device will ask if you are agree to connect the computer id.
You need to confirm it.
5. Now Check the device
It is now authorized!
adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d device
After doing this Need to install the Samsung Kies to show up the phone in the list of "Running Android devices".

Categories

Resources