How to enable usb debugging mode? - android

I forgot my mobile pattern and now i wanna recover without factory reset of my device.
The developer options is turned off and I cannot turn on usb debugging as well.
How do I enable usb debugging and remove my pattern?
I cant even run adb commands, because when i run adb devices I don't see any devices listed there.

This is not possible, for security reasons - if it were possible, someone who had stolen your phone would be able to unlock it as well.

I don't think this is possible. Upon googling though, I found a link. I am not sure if it works but you can give it a shot.
https://technastic.com/usb-debugging-using-adb-command/
Please note that debugging must be enabled on your phone so that ADB can detect and communicate with it.
You can disable Developer options and USB debugging using the following commands respectively.
settings put global adb_enabled 0
settings put global development_settings_enabled 0
Try them and share if they work for you.

Here's a link.
I.e. go to About Phone in settings and tap the build number seven times.

Related

How to debug remotely

I have a situation:
1. Samsung 7 has a strange bug in my app.
2. This device is 10000 miles away from me.
What are the opportunities for debugging this device remotely.
When tester on the other side can do everything.
I tried adb tcpip <port>
but device ip can be only local(192.168.....)
The rude way is to get Android Studio there and install team viewer on the phone. It's not working every time.
And when we have 1 hour intersection it's difficult to support.
Is there any other way?
Have your user enable Developer Options on the device. You should already know how to do that.
See whether the device has Take Bug Report and/or Bug Report Shortcut settings. If you enabled Bug Report Shortcut a Take Bug Report option will appear when pressing/holding the power button.
Instruct your user to take a bug report -- either through Developer Options, or from the power menu -- as soon as your app crashes.
As for the APK you send to your user, make sure debugging is enabled, so you get all your log messages. If you obfuscate the APK, be sure you keep your mapping files handy.
If you have some idea of where the bug is happening, an option could be to set up something like http://www.acra.ch/ and send your tester a new apk.
This way when the bug is provoked, given you set up useful log events, you will receive information about the crash or bug. ACRA lets you include the LogCat as well, which is pretty useful.
There are several options:
-Build APK and send it to the phone. Install and check/try again.
-Create Android Virtual Device identical to the model located remotely, install Samsung Android firmware.
There is no clear solution about debugging out of local network.
You could try something like LogmeIn for Android - this way both devices will be in the same network.
Once done, just do usual adb connect ipadress If t refuses to do so first, try enabling ADB over WiFi option

Android development with no screen

I have a hobby android app idea that basically just uses Android's sensors and logs them long term for several days (external battery). The sensors needed are in $200 phones, and I can get ones for under $100 if the screen doesnt work.
My question is, is it pretty easy to make an app that starts and loads via debugging, keeps running when disconnected and when I connect I can extract the log file, or would this so be difficult I would be ahead just to spend the extra $100?
As mentioned, turning on USB debugging without the screen isn't possible. You can't enable USB debugging over USB for security reasons, so your only option would be to use hardware commands to put the device in firmware download mode (presumably it will have a way to do that), then load a custom OS which allows USB debugging by default.
Personally I think that's more than $100 worth of work, so I'd just go with the working device. Then you can use it for other stuff down the line.
Alternately, you can probably get a replacement screen for not too much, and for most devices changing the screen is relatively easy. I'd look into that option as well.
The first barrier you may find is that you must activate the Developer Options in the settings and the USB Debugging. And when you connect to the computer, you must accept that cumputer as the Debugger.
I don't know if it's possible to do it without a working screen.
App will keep running & yes you can can extract the log file when connecting again.
But the problem is in the first step. if your screen if not working, then how would you add your workstation as a trusted device in your "display not working device". I doubt if there is such way, because we need to do several things like switching on developer options, usb debugging etc.
I hope you got your answer.

Android Diagnostic Mode - How to Enable it?

I would Like to enable Diagnostic (DIAG) Mode on Android.
I have the following questions about the same.
How is DIAG mode helpful ?
Is Rooting the Device necessary to enable DIAG Mode ?
How to verify if DIAG mode is enabled ?
Is it reversible ? Can i go back to Normal Mode ?
I'm using Google Nexus 5.
I'm fairly new to Android Development.
Any help would be appreciated.
1- I personally use DM to collect and analyse the messages between a mobile (UE) and a network. I use it with Qualcomm QXDM and QPST tools to analyse wireless protocol stack messages. With commercial phones, usually the DM is blocked as a security measure as it allows you to decapsulate the messages sent/received by the UE. I haven't heard about another use for it until now.
2- Yes all the commercial UEs I worked with ( mostly with Sony Xperia and currently with Xperia Ray) are rooted.
3- If DIAG mode is enabled, you can see it in your Device Manager. Here is a snapshot of mine. That means you have to install the correct drivers for the device (which was tricky with many phones). The device should has Qualcomm Chipset!
4- Yes you can unroot the device. Never tried with Nexus myself.
Can I ask what is the purpose of using it for you? I mean it's strictly working with protocol stacks.
Hope it helps! Cheers
Diagnostics Mode can be used to change your device's radio band & modem settings and other stuff like changing IMEI address or MAC Address, if you have appropriate software like DFS CDMA Tool or QPST.
You can enable it only if your phone is rooted.
Make sure Qualcomm drivers for your phone are installed in computer.
Enter this in Terminal Emulator in your device:
su
setprop sys.usb.config diag,adb
Note: This will work only if your phone's ramdisk has the appropriate configs enabled for the 'diag,adb' property.
If that didn't work, better open /init.xxxxxxx.usb.rc (xxxxxxx represents your device's codename or chipname or whatever) and check for properties related to 'diag'.
To verify if it's working, just check the Device Manager or the tool you're using & check if your phone gets connected.
Yes, it's reversible. To get back to normal mode, just type this in Terminal Emulator:
setprop sys.usb.config mtp
You'll get back to MTP mode :)
If you mean the developer options, then as of Android 4.2 I believe, one of the things about the developer options is that the menu is just hidden now. You have to purposely enable the menu to access the options.
It's helpful because you need it to help debug your apps while it's connected to your computer and the SDK. There are a lot of options there, depending on what kind of app you are making. Enabling the menu by itself does not do anything to your device.
No it's not necessary.
If you see developer options in the settings menu, then you know it's enabled.
All you are doing is unhiding the hidden developer menu. Not really anything to reverse. You can just turn off the options you turned on during development.
I dont know much about DIAG mode but it's used when you want to read data from phone using qualcomm settings. To get into DIAG mode use ##3424# or *#7284#. And enable DM+MOdem+.. on.
If the following command does not work:
su setprop sys.usb.config diag,adb
You can try:
su setprop sys.usb.config diag,serial_cdev,rmnet,adb
Both set of commands require root. The difference has to do with modem processors.

Changing Android adb debug settings programmatically from recovery

I'm trying to set up 60 Galaxy Tab 2 devices, by flashing CyanogenMod and then gapps onto each one. Unfortunately, at the moment I need some manual intervention on each one, which is annoying.
I can programmatically turn each one on and boot it into recovery mode, and then flash the CM ROM. It then automatically reboots the tablet, though, and I can't touch it after that because the default bootup doesn't have adb debugging turned on. I thus have to turn it back off, or boot it into recovery mode manually, before the next step.
What I would really like to do is to use adb while it's in recovery mode to turn on USB debugging, so that when it reboots, I'll be able to get to it. Ideally I'd just change a setting (use SQLite3 to change something somewhere?), but I could if necessary rebuild the CM11 zip to incorporate the setting somehow. I think I will need to turn on debugging, and also add the computer's RSA fingerprint so that it's allowed to talk to the device.
Any idea on how I can do this?
I could if necessary rebuild the CM11
A possible way for this option is to set ro.debuggable=1 in build/core/main.mk even for user builds. However, please note that that could lead to security breach as USB debugging is not meant to be used by normal end users.

Enable USB debugging on Android

I am trying to enable USB Debugging on Android so that I don't need to use the emulator.
I did what all the posts all around the web say to do: I went to settings -> applications -> Developer -> USB debugging
It still does not turn on the notification sign that USB Debugging is enabled, and Eclipse does not recognize it, and uses the regular emulator.
Does anyone have any idea what is wrong?
You haven't specified what device you are using or what operating system you are using, so that could be helpful.
A few things to keep in mind:
1 Don't mount as USB storage.
2 You also need to make sure to install the drivers for your phone so that the Android Debug Bridge (ADB) can properly communicate. After these are installed, try the command "adb devices" and you should see an item in your list of devices.
Update based on your comment: You can download Kies from Samsung, which include the drivers (as well as other things): http://www.samsung.com/us/kies/
Or you can find unofficial driver-only packages, such as: http://forum.xda-developers.com/showthread.php?t=961956
I think you'll need the OEM USB dirvers.
Read this:
OEM USB Drivers
My experience with windows has been that you might need to un-install the USB drivers under device manager. Then disconnect the device (restart might be required). After plugging the device back in make sure you use the manufactures drivers if available
you have installed your device driver rite?then right click on your app name->run as->run configurations->target->select manual->apply.after that click on debug button then it will ask you to select the device.
If everything else is tested, try with another USB cable.
On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.
Fruthermore on some devices you will be asked to accept an RSA key, which allows debugging through your computer. This ensures that other adb commands cannot be executed unless you're able to unlock your device.
Detailed information can be found here:
http://developer.android.com/tools/help/adb.html It is the overview about adb commands (which is used to send data to your device) and it starts with the steps how to bring your phone to debug-mode.
I wish to add to Danation's answer with the following.
If you have installed KIES, and you've tried following instructions a couple of times (for the android SDK package) without success, here's what worked for me:
As a precaution, disconnect the device, and press 'Revoke USB Debugging authorizations'.
Now, go to kies, and reinstall the device driver as seen on the image below.
Connect the device.
For me, it was a routine, it usually works when installing kies, but I was stuck on this today for a little while, and I hope i can help others with my solution as well..

Categories

Resources