I use ADT to try to make android apps, and use AVD. I know there is another tool called adb. I know it has been installed, and I want try to use it to send commands. Where is it? How to open it? Which button is used to open ADB in ADT?
Another question is where are the API documents? How to find it except on the website, like download or whatever?
You should find it in :
C:\Users\User Name\AppData\Local\Android\sdk\platform-tools
Add that to path, or change directory to there. The command sqlite3 is also there.
In the terminal you can type commands like
adb logcat //for logs
adb shell // for android shell
In Windows 10 while installing Android SDK, by default latest SDK gets installed.
Platform List is part of Android SDK and the best way to find the location is to open SDK manager and get the path.
It will be available at:
Android SDK Location: C:\Users\<User Name>\AppData\Local\Android\sdk\platform-tools\
In SDK Manager, SDK path can be found by following the below
Appearance & Behaviour --> System Settings --> Android SDK
You can get the path where SDK is installed and can edit the location as well.
If you have downloaded the AS + SDK bundle: in Windows 10
C:\Users\ your User Name \AppData\Local\Android\sdk\platform-tools\
Run adb.exe
Type adb shell.
Now able to access adb and the db.
The adb tool can be found in sdk/platform-tools/
If you don't see this directory in your SDK,
launch the SDK Manager
and install "Android SDK Platform-tools"
Also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
The short answer is adb is used via command line. find adb.exe on your machine, add it to the path and use it from cmd on windows.
"adb devices" will give you a list of devices adb can talk to. your emulation platform should be on the list. just type adb to get a list of commands and what they do.
Check out Android Documentation Managing Virtual Devices
I am using Windows 7 and JDK 6.
I downloaded the package of Android SDK with Eclipse and followed the instructions to create the first Hello World application.
However, when I stand on MainActiviy.java and click on run I get the following error in the console:
Connection with adb was interrupted You may want to manually restart
adb from the Devices view.
I tried many answers that I saw here:
1. Restart adb server
2. Make sure that the path is to the correct JDK
3. I went over preferences and didn't see any warning or error.
I can run the emulator- and it works fine. But it doesn't run the Hello World application.
What is wrong?
I had to go to DDMS view, and in view menu of the devices, to choose:
restart ADB.
This made everything work fine
Here are followed list of options what you can do to try to fix that issue:
Run: adb kill-Server , after adb start-Server
Try to disable and after set enable USB debugging on device.
While doing that pulling out the USB cable and putting it back in also helps.
Just wait, sometimes it happens if it up slowly and Eclipse drop this error.
Try to kill adb.exe through Task Manager. It will restart by different way.
You can try to up performance to your Eclipse (mostly for Android):
open eclipse.ini and set:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m`
try to disable firewall
Uninstall previous versions of JRE or JDK (if you have ones in additional to new that you currently use). After, restart Eclipse
Does DDMS see your emulator? Try to restart adb through DDMS
Also add (if still you didn't) ADB to global path: My Computer -> Properties -> Advanced System settings -> Environment Variables -> press New... name: ADB; value: <your android SDK path>\platform-tools. after add to path %ADB%
Expanding on Dejel's answer above with one change:
Window -> Open Perspective -> DDMS (DDMS could be in the "Other..." section)
Window -> Show View -> Devices (if not already visible on the left pane)
Under the view-meny (little downward-pointing triangle on "Devices" header) choose "Reset adb" (Restart may have been renamed to "reset" in newer versions).
Me too had the similar problem. Struggled alot to resolve and finally this worked out for me.
Remove all the folders in the root folder of workspace(except workspace folder) like .android, .eclipse, .metadata etc
Save your platfoms to some safer place and delete the folder "adt-bundle-windows-x86-20130729"
Unzip the bundle again to some other locations
Try running the eclipse again and create an application
Run the application and see whether emulator automatically gets starting
Paste back ur platforms
This worked for me on my 4th attempt.
I did some thing very simple.. I copied the adb.exe from users folder (users//android-sdks/platform-tools to tools folder under android-sdks.
Then in preferences under Android i clicked "restore Defaults" then again browsed back to C:\Users\\android-sdks then clicked on the latest API (19) clicked ok..
then it worked!!
This worked for me:
simply go to device manager in your laptop or pc -> go to processes -> click on adb and -> click on end process.
Now go to sdk folder (it may be locate various location in your drive) and right click on adb.exe and click run as administrator.
Now check if it works fine.
This always works for me. Follow these steps :-
Close Eclipse.
Kill adb.exe from Task Manager (Windows Only)
Disconnect your device.
Reconnect your device.
Start Eclipse and Wait for Eclipse to build workspace.
P.S. This works perfectly on a Physical Device. I haven't tried it on Emulator.
I have read a few articles that BlueStacks App Player can be used to debug android apps via Eclipse, instead of the default android emulator.
Example article
But I think this refers to the Windows version, I was unable to get to it work on MacOS. Does anyone know how to debug using BlueStacks/eclipse on MAC?
adb connect localhost:10001
should do the trick.
Well, you can try another way:
1) First, open the DDMS via Window->Open Perspective->DDMS under Eclipse.
2) Then open BlueStacks App Player.(leave it opens)
3) After that switch back to Eclipse and you should notice there're two emulator under the Device tab.
Then click Reset adb under the small triangle at the Device tab.
After a few seconds, the another one emulator will disappear and you can proceed to the next step.
4) Then return back through Window->Open Perspective->Java under Eclipse.
5) Select your project and right click on it, choose Debug As->Debug Configurations
6) Under Android Application select your configuration or create a new one. On the Target tab choose Always prompt to pick deviceAfter this, select Apply then Debug.
7) Then select BlueStacks emulator in the prompt window, and finally select OK.
Alternatively, you can also open the BlueStacks App Player before Eclipse using the above steps(with minor changes).
For more info, visit the below links.(However, in Chinese...)
http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746950.html
http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746979.html
Hopefully this will help you.
C:\>cd Program Files (x86)\Android\android-sdk\platform-tools
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb connect 127.0.0.1:5555
connected to 127.0.0.1:5555
C:\Program Files (x86)\Android\android-sdk\platform-tools>
Run Bluestacks.
open Command Prompt in Windows.
Go to Platform-tools using following command.
cd C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
then write:
adb devices
With SDK tools 27 and later!
You get a list of devices detected by adb .. if BlueStacks-4 is installed you should see the device listed (emulator-555x).
For Mac users: localhost:5037 worked for me
BlueStacks bundles its own copy of adb, %PROGRAMFILES(x86)%\BlueStacks\HD-adb.exe. You can connect localhost with it, or any other command. BlueStacks 3 uses the default port 5555.
When i enter "adb install asdasd.apk" to cmd returns "error:device not found". How can I fix this?
Just copy that apk file into ( D:\android-sdk\platform-tools ) android sdk platform tools.
and then open the cmd prompt.
then, come into that platform tools path in cmd prompt.
then, give like this in cmd -- adb install (appName).apk
wait few minutes and get success respomse in cmd prompt..
First, familiarize yourself with a concept of AVD. That's basically an instance of the emulator - it has a bunch of settings, like the Android version to use and screen size and an SD card image.
You cannot install stuff "in the emulator" - you can only install stuff into a specific AVD. For that, you need to create and run an AVD first. For that, use "AVD Manager" from Eclipse or standalone.
Under the Android SDK folder in Explorer, run "AVD Manager". Choose an AVD (or create a new one if you don't have any). Select, click "Start".
Does the emulator show up when you run the following command?
adb devices
If not, you might have to boot up the AVD first, but if I remember correctly it should be starting it up by itself.
Have you created a new emulator for your project? And are you using Eclipse? Eclipse has an ADT plugin which is useful as it allows you to open the AVD manager through it. This plugin will give you this option in the Windows tool bar of Eclipse: Windows>AVD manager.
Create a new project based on the emulator and click the run button which will install your project onto the emulator. If you have an Android device I recommend turning USB development mode in your phones settings and running your project straight onto your device as it will be a lot faster. Hope this helps
this is what i did :
first run the "AVD Manager"-> choose an AVD -> click "Start"
immediately after
you click on "Start"
use command on cmd as,
adb install asdasd.apk
then in my case (Windows), asked to place .apk file in data/local/tmp/
what i did was copy and paste .apk file into data/local/tmp
and again use command
adb install asdasd.apk
then cmd prompted-> Success
You can also use command
adb devices
command for check whether emulator is in the list
Actually you may need to run AVD several times
I've spent days trying to launch any Android program. Even "Hello World" gives me the same error:
"The connection to adb is down, and a severe error has occurred".
I'm running Eclipse v3.5 (Galileo), Google APIs 2.2.8, on a Windows XP machine.
I've used all the tricks I can find on the web: the command line "adb kill-server", the DDMS "reset ADB", I started the emulator both before and after Eclipse, and searched for ports being used by other programs.
What is going on here? Is there a magic combination of versions of Eclipse, Java, ADB, emulator, and whatever else that works?
Try the below steps:
Close Eclipse if running
Go to the Android SDK platform-tools directory in the command prompt
Type adb kill-server (Eclipse should be closed before issuing these commands)
Then type adb start-server
No error message is thrown while starting the ADB server, then ADB is started successfully.
Now you can start Eclipse again.
It worked for me this way.
Restart your phone as well!
Use:
Open Task Manager → Processes → adb.exe → End Process → restart Eclipse
This worked for me.
And:
Open Task Manager → Processes → eclipse.exe → End Process → restart Eclipse
Open up the Windows task manager, kill the process named adb.exe, and re-launch your program.
[2012-07-04 11:24:25 - The connection to adb is down, and a severe error has occurred.
[2012-07-04 11:24:25 - You must restart adb and Eclipse.
[2012-07-04 11:24:25 - Please ensure that adb is correctly located at '/home/ASDK/platform-tools/adb' and can be executed
I realized the folder of the project in Eclipse was closed. I expanded the directory and the project launched. I know this may sound like a "no-brainer". I had the .java files open on the workspace, and that was enough to make me think the project was open.
I tried this using Eclipse Juno and it worked fine:
From the dropdown of the Run icon, select option Run Configuration.
Make sure your project is selected
Go to tab Android
Under section Launch Action, select Launch Select the package name
and voila! try running your application.
UPDATE: It also helps to kill the process adb.exe from the task manager and restart it. adb.exe can be found here: Android\android-sdk\platform-tools.
Good luck
Update your Eclipse Android development tools. It worked for me.
Make sure it's not running in the task-manager processes. If so, end the process and then start it from a command prompt as in a previous answer. This worked for me.
In my situation: I have the same warning:
The connection to adb is down, and a severe error has occured
I have found the solution:
The adb.exe was moved from: android-sdk-windows\tools\adb.exe to
android-sdk-windows\platform-tool\adb.exe.
Only thing. Move file adb.exe to \tools. And restart Eclipse.
I know this question has already been answered, but thought I might add that I found the problem to be folder permissions on my android-sdk directory.
I tested it out by granting Full Control to Everyone (dodgy, I know...), and the problem went away. I am not sure yet what the specific mix of permissions might be that it was looking for, but I assume some or other service in Eclipse didn't have execute permissions on adb.exe. That said, I'm a complete noob to this - just wanted to put it out there in case someone else had some insights into this.
I am running Windows 7, 64-bit, 4.2.0 Eclipse, and 20.0.0v201206242043 ADT.
Go to the folder platform-tools in cmd folder platform tools available in the Android folder where you have Android backup files.
Type the following
adb kill-server
and
adb start-server
then type
adb devices
adb kill-server
You can now see your device.
This problem has been plaguing me for days until I finally figured out what was causing it. It got so bad I couldn't even update my apps even after trying all the above suggestions.
HTC Sync also runs a process called adb.exe. HTC Sync is an optional program available when installing the HTC USB driver. I had recently updated my installation of the HTC bundle and apparently hadn't installed HTC Sync before. Checking properties on adb.exe in the Task Manager showed it to belong to HTC Sync, not Android.
As soon as I uninstalled HTC Sync from the control panel the problem disappeared! (It's listed separately from the USB driver so that can stay.) I never saw more than one instance of adb.exe running. I'm curious to know if people having to kill the process from Task Manager, check to see if it's actually the Android process you are killing?
Please read user comments (I too have a HTC Thunderbolt):
http://www.file.net/process/adb.exe.html
Simply go in Task Manager (windows users) and kill the abd.exe (it is remaining active somehow).
After that start Eclipse.
The error
"The connection to adb is down, and a severe error has occured"
happened after installing plugin for Android of Netbeans. After closing Netbeans the process abd.exe remained active. When you want to start again Eclipse ... you will get the error.
You have to manually kill the adb.exe and then start Eclipse.
It worked for me.
I had the same problems, and it turned out that my antivirus program (Comodo) sandboxed the adb.exe, and that is why it didn't work. I closed the antivirus, and it worked just fine. Consider that.
My problem was that my firewall was preventing ADB from binding to the port it wanted to.
I had the same problem
I entered Task manager -> find adb.exe -> end process
Go to the Android SDK tools directory in Command Prompt double click adb.exe
That's all
I am running Eclipse Neon2. on Mac OS 10.12.4 and I experienced this issue after recently upgrading my Android SDK to the latest "SDK Tools" (v 25.2.5), "Platform tools" (v 26) and "Build Tools" (v 26) and moving one of my development projects to Android Studio.
Unfortunately none of the many answers here worked for me.
What did work was to create a separate copy of the Android SDK in a different folder and then point Eclipse to it via "Preferences --> Android". You will have to use an older version of the SDK as indicated in this SO answer.
Once you've downloaded the separate version of the SDK and put it in a different folder than your main Android SDK, launch the SDK Manager (via <separate-sdk>/tools/android) and install the required "Platform tools", "Build-tools" and Android versions. There are two important things to observe here though:
Make sure that you do not upgrade your "SDK Tools" beyond the version that's already installed!
Make sure that you install a version of the "Build tools" that is less than 26!
Otherwise you may run into this issue.
Go to the tools folder of your Android SDK
Run emulator.exe -avd <your avd>. It will take some time for the emulator to run.
Once you see the homescreen on your emulator, open Eclipse and run your program again...
I had a similar problem. I found out that there was another adb.exe running which was started from BirdieSync (Sync Tool for Thunderbird). I found out with Process Explorer from Sysinternals, that Windows was running another incompatible adb.exe. Just put the mouse cursor above the process (in Process Explorer), and you'll see which adb.exe is started.
I had to kill the BirdieSync process as well, because it started the wrong adb.exe again.
Then I could start the right adb.exe, and it worked fine.
The killing of the mysteriously running abd.exe worked. This sudden roadblock stopped me for a long time. I was doing all sorts of command line stuff and removed the lock icon from my user folder, but nothing worked until your simple suggestion of looking for the abd in the running processes of the task manager and killing it.
Another newbie roadblock I discovered an answer to: don't run Eclipse when any file other than the main .java file is active. If you run it when, for example, the main.xml file is active, you will get unhelpful error messages, an odd file created like main.xml.out, and it wont run.
I found the path of the SDK (Preferences* → Android → SDK Location) was the cause. My SDK path was the following:
C:\Program Files (x86)\Android\android-sdk
The spaces in the path is the problem. To get it to work, you must change Program Files (x86) to Progra~2
The complete right path is C:\Progra~2\Android\android-sdk.
Now it should work.
The previous solutions will probably work. I solved it downloading the latest ADT (Android Developer Tools) and overwriting all files in the SDK folder.
http://developer.android.com/sdk/index.html
Once you overwrite it, Eclipse may give a warning saying that the path for SDK hasn't been found, go to Preferences and change the path to another folder (C:), click Apply, and then change it again and set the SDK path and click Apply again.
Close Eclipse
Use this in the terminal:
sudo killall -9 adb
Run Eclipse.
If you are using the Genymotion emulator:
Make sure that the SDK path used for Genymotion is also the same path used for the Eclipse.
This error also occurs if those two paths are different.
I've tried the above methods, end the adb process through task manager and all, it didn't work. But when I ran the adb.exe file as admin it worked fine.
Here is a script I run to restart adb (Android Debug Bridge) server:
#!/usr/bin/env bash
## Summary: restart adb (Android Debug Brdige) server.
## adb binary full path
ADB_BIN=./adb
if pgrep adb >/dev/null 2>&1
then
echo "adb is running"
echo "terminating adb ..."
$ADB_BIN kill-server
if pgrep adb >/dev/null 2>&1
then
echo "did not work"
echo "kill adb processes by killall"
killall -9 adb
else
echo "terminated"
fi
else
echo "adb is not running"
fi
echo "starting adb ..."
$ADB_BIN start-server
echo "adb process:"
echo `pgrep adb`
echo "done"
# END
Last time I faced this problem, was solved with adb restart. If you have tried adb kill-server and adb start-server with no luck you might want to try this. When again I faced the same issue I tried all the above answers, with no luck, and this was the last option to try. It did work like a charm.
Goto Android SDK Manager >> Install the essential packages.
maydenec is correct (in my case...). The file was moved.
I even found this file:
C:\Program Files (x86)\Android\android-sdk\tools\adb_has_moved.txt
Which explained this issue.
Suggestions in this file:
Install "Android SDK Platform-tools".
Please also update your PATH environment variable to
include the "platform-tools/" directory.
It worked for me to start my AVD emulator first (from the AVD manager), and then to run my program. The other stuff mentioned here.
(Restarting the ADB server didn't work though.)
Eclipse → preferences → Android → NDK
Check the "NDK Location" path is set correctly, and use the browse button to set it.
AndroidSDK → Platform Tools → Kill did not work.
But after restarting my computer, it worked.