Posts

Showing posts with the label Adb

ADB Over Wireless

Answer : Rooting is not required. With USB cable connected, port 5555 opened across all involved firewalls and debug mode enabled adb tcpip 5555 then look into wireless properties of your device and the network you use, to see which IP address have been granted to device (or configure your DHCP always to use the same for the device mac address). Then adb connect 192.168.1.133 (were 192.168.1.133 is a sample IP address). This is all. You can now use adb shell or adb install or adb upload or the like with USB cable plugged out. To switch back to USB mode, adb usb The device may also revert back to USB mode after reboot. This mode is needed for development of applications that use attached USB devices directly (USB port is used by device so cannot be used by ADB). It is briefly covered in the USB debugging section of the Android website. I ran into the same problem today and find that things are fine on my non-rooted 4.2 Galaxy Nexus device, but does not work on m...

Adb Kill-server Not Responding?

Answer : I also came across the same error when I was trying to install one app in emulator. You need not restart PC to overcome this. Just kill the server. if 'adb kill-server' is also not working, kill the process (adb.exe) through task manager. There you go!! Task Manager -> Process -> adb.exe -> End process That worked for me. If zombie adb process is not the issue i.e. there's no adb.exe in the task-manager list, the problem is usually adb ports e.g. 5555, 5554, 5037 etc., being taken by other applications. Solutions: On all Windows : find the process taking one of those ports using netstat -bn and kill it from task-manager Ctrl+Shift+Esc is the shortcut. On Windows 7 and 8 : there's this new tool called Resource Monitor . It'll also allow you to find out the blocked port and blocking process under the network tab. On Linux : the similar is done with netstat -pn . Feel free to use your grep foo as needed and kill the blocking pr...

Android-studio: Unable To Locate Adb

Image
Answer : A couple of days after posting the above solution, the problem returned on my Windows system. Finally after several hours of investigation I think I have another solution for everyone having issues with AVD Manager "Unable to locate adb". I know we have the setting for the SDK in File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK. This it seems is not enough! It appears that Android Studio (at least the new version 4) does not give projects a default SDK, despite the above setting. So, you also (for each project) need to go to File -> Project Structure -> Project Settings -> Project, and select the Project SDK, which is set to [No SDK] by default. If there's nothing in the drop-down box, then select New, select Android SDK, and navigate to your Android SDK location (normally C:\Users[username]\AppData\Local\Android\Sdk on Windows). You will then be able to select the Android API xx Platform. You now sho...

'adb' Is Not Recognized As An Internal Or External Command, Operable Program Or Batch File

Answer : Set the path of adb into System Variables. You can find adb in " ADT Bundle/sdk/platform-tools " Set the path and restart the cmd n then try again. Or You can also goto the dir where adb.exe is located and do the same thing if you don't wanna set the PATH. If you wanna see all the paths, just do echo %PATH% From Android Studio 1.3, the ADB location is at: C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools. Now add this location to the end of PATH of environment variables. Eg: ;C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools If you want to use it every time add the path of adb to your system variables: enter to cmd (command prompt) and write the following: echo %PATH% this command will show you what it was before you will add adb path setx PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools" be careful the path that you want to add if it contains double quote after you restart your cmd rewrite...

Android Emulator Snapshot File Location

Image
Answer : To retrieve the saved snapshot on disc, you have to go to the AVD location. In Android Virtual Device Manager, right click on your AVD, then show on disc . You will find a directory call snapshots There's now a setting for this in the Emulator itself. In the options menu, tap on the Three Dots button to open Extended Controls. Tap the 'Settings' item in the left-hand list and you'll see 'Screenshot save location', which is an editable field. Press for 3 dots. Then Press the Settings and in top right corner you will see the screenshot folder location.

Android - Adb Push ... Permission Denied

Answer : Edit: I found a work-around: AirDroid allows me to upload the file, but the permissions on the file are set to this: -rw------- Performing the following commands solves this problem (from Windows 7 command prompt). >adb shell # su # chmod 777 /data/data/com.me.app/databases/data.db The usual approach, which doesn't require any additional apps: Push to /data/tmp/ ; Copy on the device using adb shell , using cp if it's available on your device or cat if it isn't. > adb push data.db /data/tmp/data.db > adb shell # su # or run-as com.me.app # cp /data/tmp/data.db /data/data/com.me.app/databases/data.db Remembering to change com.me.app to the correct package name for your app.

Android - Can I Enable USB Debugging Using Adb?

Answer : I got it to work :) NOTE : This requires unlocked bootloader. Connect the device to Mac or PC in recovery mode . (I had to map the process in my mind as the screen was broken). Now open terminal/CMD in computer and go to platform-tools/ . type and enter ./adb devices to check if the device is connected in recovery mode. Now type ./adb shell mount data and ./adb shell mount system to mount the respective directories. Get the persist.sys.usb.config file in your system using ./adb pull /data/property/persist.sys.usb.config /Your directory Now open that file in a texteditor and edit it to mtp,adb and save. Now push the file back in the device; ./adb push /your-directory/persist.sys.usb.config /data/property Get the build.prop file; ./adb pull /system/build.prop /your-directory Add these lines: persist.service.adb.enable=1 persist.service.debuggable=1 persist.sys.usb.config=mtp,adb Push build.prop back into ...

Android Studio Doesn't See Device

Answer : I recently had trouble with this, and regardless of what I did(restart adb, edit adb_usb.ini, restart computer+device+swap usb port, reinstall studio etc. etc.) I just couldnt get it to work, and could not even detect my device using 'adb devices'. Finally after about 2 hours of googling and testing, someone suggested switching to PTP instead of MTP on my device. When I did this I got a popup on my device asking me to allow my mac access and suddenly everything worked(had to restart studio for it to show up there as well though). I might be bumping this thread now, but it is the first result on google search, and I had a lot of trouble finding an answer for this problem, so I thought this should be added as a solution. On your device: Go to settings/ developer settings/ allow USB debug mode If 'allow USB debug mode' option is disabled. Then you might have the device currently connected to your PC. Disconnect the device and the option should now...

Adb Pull Multiple Files

Answer : You can use xargs and the result of the adb shell ls command which accepts wildcards. This allows you to copy multiple files. Annoyingly the output of the adb shell ls command includes line-feed control characters that you can remove using tr -d '\r' . Examples: # Using a relative path adb shell 'ls sdcard/gps*.trace' | tr -d '\r' | xargs -n1 adb pull # Using an absolute path adb shell 'ls /sdcard/*.txt' | tr -d '\r' | sed -e 's/^\///' | xargs -n1 adb pull adb pull can receive a directory name instead of at file and it will pull the directory with all files in it. Pull all your gps traces in /sdcard/gpsTraces adb pull /sdcard/gpsTraces/ . Example of adb pull and adb push of recursive directories: C:\Test>adb pull /data/misc/test/ . pull: building file list... pull: /data/misc/test/test1/test2/test.3 -> ./test1/test2/test.3 pull: /data/misc/test/test1/test2/test.2 -> ./test1/test2/test.2 pull: /data/...

Android Studio Logcat Not Showing Logs

Image
Answer : In my case in Android 2.2, for some reason, Firebase was selected by default in the dropdown box marked above. So logs didn't drop. I just needed to change it to No Filters . Then it worked. I even tried restarting the logcat, that didn't work too. No Filters did the magic. Hope this helps someone. Edit : You can as well select Show only selected application for logcat to show only the current debugging process, i.e your app. You may be hiding it, try pressing Alt + 6 to open Log tab. Look at the log level:- it must be verbose. Restart adb. If that doesn't works restart the android studio. In Logcat window reselect your device then reselect your app if it didn't appear restart adb using two commands: adb kill-server adb start-server Happy debugging :)

Adb Command Not Found

Answer : In my case with Android Studio 1.1.0 path was this /Users/wzbozon/Library/Android/sdk/platform-tools Add the following to ~/.bash_profile export PATH=~/Library/Android/sdk/tools:$PATH export PATH=~/Library/Android/sdk/platform-tools:$PATH Is adb installed? To check, run the following command in Terminal: ~/Library/Android/sdk/platform-tools/adb If that prints output, skip these following install steps and go straight to the final Terminal command I list: Launch Android Studio Launch SDK Manager via Tools -> Android -> SDK Manager Check Android SDK Platform-Tools Run the following command on your Mac and restart your Terminal session: echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile Note: If you've switched to zsh, the above command should use .zshenv rather than .bash_profile Make sure adb is in your user's $PATH variable. or You can try to locate it with whereis and run it wit...

ADB Android Device Unauthorized

Answer : 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 Ohhh finally I figured it out! After removing Eclipse directory I installed it into another directory. echo %ANDROID_SDK_HOME% has displayed wrong p...

Adb Logcat Hangs With "waiting For Device" Message

Answer : I am not pretty much sure if this works for you but can you please try the steps below: # Kill and restart $ adb kill-server $ adb start-server daemon not running. starting it now * daemon started successfully * # Device appears, but is listed as offline $ adb devices $ adb logcat I have also experienced similar problems I think I solved it by having the USB debugging option switched on within Developer Options in Settings. REPEAT The following steps above, it should work! Here is yet another potential method to solve this -- in the past, the above solutions will work, but in my case, this time, this was the thing that fixed it: Plug device into USB Settings -> Developer Options Revoke USB Debugging Authorization Unplug Device Repeat Step 1 Authorize Device Repeat Steps 4&5 adb devices should now show device adb logcat should now output logs from device

Android: Adb: Permission Denied

Answer : According to adb help : adb root - restarts the adbd daemon with root permissions Which indeed resolved the issue for me. Without rooting : If you can't root your phone, use the run-as <package> command to be able to access data of your application. Example: $ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/ exec-out executes the command without starting a shell and mangling the output. The reason for "permission denied" is because your Android machine has not been correctly rooted. Did you see $ after you started adb shell ? If you correctly rooted your machine, you would have seen # instead. If you see the $ , try entering Super User mode by typing su . If Root is enabled, you will see the # - without asking for password.

Adb Server Is Out Of Date. Killing... Cannot Bind 'tcp:5037' ADB Server Didn't ACK * Failed To Start Daemon * In Ubuntu 14.04 LTS

Answer : You need to set the path of your SDK's adb into Genymotion. By default, Genymotion uses its own ADB tool (for many reasons). If the both binaries are not compatible (if your Android SDK platform tools or Genymotion has not been updated for a while) this problem happens. To solve it you can define a specific one from the Android SDK. To specify a custom ADB tool: Open Genymotion > Settings > ADB. Check Use custom Android SDK tools. Specify the path to the Android SDK by clicking Browse. Click OK. update the adb to 1.0.32 if you have 1.0.31 or lower adb version Android Debug Bridge version 1.0.31 wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb sudo mv adb /usr/bin/adb sudo chmod +x /usr/bin/adb adb version Android Debug Bridge version 1.0.32 for me the problem was that I am trying to use 2 adb processes sudo apt-get remove adb android-tools-adb and...

Android ADB Device Offline, Can't Issue Commands

Answer : Try running adb devices after running adb kill-server . Security question pops up after that. Worked for me. I just got the same problem today after my Nexus 7 and Galaxy Nexus were updated to Android 4.2.2. The thing that fixed it for me was to upgrade the SDK platform-tools to r16.0.1. For me, this version was not displayed in my SDK Manager, so I pulled it down from http://dl.google.com/android/repository/platform-tools_r16.0.1-windows.zip directly. You then need to rename the platform-tools directory and unzip it to android-sdk-windows/platform-tools . Using the SDK Manager, I had also updated to the latest sdk-tools before this. If your whole Eclipse and ADT are ancient, you may need to update them as well, but I didn't need to. Note: you may need to run SDK Manager twice (once to update itself) before you will see the latest packages. It also seems to occur frequently when you connect to the device using the Wi-Fi mode (in Android Studio or in the cons...

Android ADB Devices Unauthorized

Answer : Try Revoke USB DEBUGGING Authorization. Enable USB debugging again. It worked. Thankgod xda developers exist : http://forum.xda-developers.com/verizon-lg-g3/help/unable-to-access-adb-t2830087 Just had to delete adbkey file in C:Users/$Name/.android adbkey.pub was missing. Restart after this and both files are there. If this does not work : - Try Revoke USB DEBUGGING Authorization. - Enable USB debugging again. In sequence: adb kill-server in your DEVICE SETUP, go to developer-options end disable usb-debugging press REVOKE USB debugging authorizations, click OK enable usb-debugging adb start-server

ADB Root Is Not Working On Emulator (cannot Run As Root In Production Builds)

Answer : To enable root access: Pick an emulator system image that is NOT labelled "Google Play". (The label text and other UI details vary by Android Studio version.) Exception: As of 2020-10-08, the Release R "Android TV" system image will not run as root. Workaround: Use the Release Q (API level 29) Android TV system image instead. Test it: Launch the emulator, then run adb root . It should say restarting adbd as root or adbd is already running as root not adbd cannot run as root in production builds Alternate test: Run adb shell , and if the prompt ends with $ , run su . It should show a # prompt. Steps: To install and use an emulator image that can run as root: In Android Studio, use the menu command Tools > AVD Manager . Click the + Create Virtual Device... button. Select the virtual Hardware, and click Next . Select a System Image. Pick any image that does NOT say "(Google Play)" in the Target column. If you dep...

Can't Attach Android Studio's Debugger To Android Process

Answer : So finally I got it working, by: Checking 'Show all processes' checkbox! BUT as you see in the question, checkbox was on at the beginning, so there were multiple issues. To summarize, these are other actions to be done: Kill all adb processes (use ps -x | grep adb and kill -9 [process id] ) adb start-server in terminal Reconnect device adb devices (to make sure device is connected successfully) Make sure Android DDMS Devices | logcat shows your app and only one device is listed. Check Show all processes checkbox. See screenshot I solved this way a. Closed Android Studio b. Did adb kill-server from a terminal. Also check the adb process in also killed from the Running processes window in PC c. Started Android Studio d. Android Studio tried to initialize adb again and back to work. It could be because the release build variant (which you can set in the Build-Variants section) has been chosen mistakenly, only debug-variant is debuggabl...

ADB Driver And Windows 8.1

Answer : UPDATE: Post with images ➤ English Version | Versión en Español If Windows fails to enumerate the device which is reported in Device Manager as error code 43 : Install this Compatibility update from Windows. If you already have this update but you get this error, restart your PC (unfortunately, it happened to me, I tried everything until I thought what if I restart...). If the device is listed in Device Manager as Other devices -> Android but reports an error code 28 : Google USB Driver didn't work for me. You could try your corresponding OEM USB Drivers, but in my case my device is not listed there. So, install the latest Samsung drivers: SAMSUNG USB Driver v1.7.23.0 Restart the computer ( very important ) Go to Device Manager, find the Android device, and select Update Driver Software . Select Browse my computer for driver software Select Let me pick from a list of device drivers on my computer Select ADB Interface from the list Select SAMSUN...