When attempting to install an .apk from Eclipse, whether to an android emulator or to a physical device (via USB), I get a "Failed to install *.apk on device '*': timeout" error.
The .apk is not found on the emulator nor physcial device (Samsung Galaxy S2, rooted).
If I avoid eclipse, and just use the command line, I'm also unable to install an .apk.
Why a new post on this?
There are several other stackoverflow posts that reference the "Failed to install..." error. I've created a new post for a few reasons:
Most of the other posts are not detailed.
The prominent relevant post, Android error: Failed to install *.apk on device *: timeout, for the original poster, applies only to physical device connections. So it is a different case, albeit with similar symptoms.
All of the candidate solutions in that post, and several others, I have tried. These are listed bellow under "Candidate solutions i've tried".
This post is lengthy as the steps I've taken are lengthy, as was warranted by the bug. If you don't want to read, or at least scan, this post please do not comment.
My Environment
HOST OS: Windows XP SP3
JAVA: Java SDK version 1.6.0_32
WINDOWS ENVIRONMENT VARIABLES:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_33;
PATH=...;%JAVA_HOME%\bin\;C:\android\android-sdk\tools;C:\android\android-sdk\platform-tools\;...;C:\Program Files\apache-ant-1.8.2\bin;...;
IDE: Eclipse (installed classic) Indigo. Version 3.7.2
ANDROID SDK
Android SDK Tools Revision: 20. (Chiefly tested with revision 19).
Android SDK Platform-tools: 11.
ADT plug-in ("Android Development Toolkit", Eclipse Plugin) version: 20.0.0.v201206010423-369331 (also with prior version 18.0.0.v201203301501-306762).
Platform targeted by your project & Version of the platform running in the emulator. Tried each off:
Android 4.0.3 (API 15)
Android 2.2 (API 8)
Andorid 2.1 (API 7)
MOBILE: Samsung Galaxy S2 running Android Ice Cream Sandwhich (ICS) 4.0.3
ANT: 1.8.2
Steps I go through to produce the errors.
Using Eclipse to attempt to install an .apk to the emulator:
Open eclipse (which loads my workspace with a single android application in it).
Run my android application using a previously configured Run configuration.
The "Android Device Chooser" launches (I have set my Run configuration to launch this manually).
In the Android Device Chooser I select my avd (targeting Android 2.2), and click OK.
The emulator opens with "5554:jlbavd2_2". My AVD name is "jlbavd2_2".
I leave the emulator open. In Eclipse I open the DDMS view. In the "Devices" pane I click on the white triangle and choose "Reset adb".
In the Eclipse console, Android view, I get
[2012-06-19 19:20:52 - MyApp] Starting full Post Compiler.
[2012-06-19 19:20:52 - MyApp] ------------------------------
[2012-06-19 19:20:52 - MyApp] Android Launch!
[2012-06-19 19:20:52 - MyApp] adb is running normally.
[2012-06-19 19:20:52 - MyApp] Performing au.com.myorg.myapp.MyAppActivity activity launch
[2012-06-19 19:20:52 - MyApp] Refreshing resource folders.
[2012-06-19 19:20:52 - MyApp] Starting incremental Pre Compiler: Checking resource changes.
[2012-06-19 19:20:52 - MyApp] Nothing to pre compile!
[2012-06-19 19:20:53 - MyApp] Starting incremental Package build: Checking resource changes.
[2012-06-19 19:20:53 - MyApp] Skipping over Post Compiler.
[2012-06-19 19:20:59 - MyApp] Launching a new emulator with Virtual Device 'jlbavd'
[2012-06-19 19:22:29 - MyApp] New emulator found: emulator-5554
[2012-06-19 19:22:29 - MyApp] Waiting for HOME ('android.process.acore') to be launched...
[2012-06-19 19:22:44 - MyApp] HOME is up on device 'emulator-5554'
[2012-06-19 19:22:44 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'
[2012-06-19 19:22:49 - MyApp] Failed to install MyApp.apk on device 'emulator-5554': timeout
[2012-06-19 19:22:49 - MyApp] Launch canceled!
In the Eclipse console, DDMS output, I get:
...
[2012-06-19 19:22:44 - ddm-hello] handling HELO
[2012-06-19 19:22:44 - ddm-hello] HELO: v=1, pid=150, vm='Dalvik v1.2.0', app='android.process.acore'
[2012-06-19 19:22:44 - MyApp.apk] Uploading MyApp.apk onto device 'emulator-5554'
[2012-06-19 19:22:44 - Device] Uploading file onto device 'emulator-5554'
[2012-06-19 19:22:49 - ddms] write: timeout
[2012-06-19 19:22:49 - Device] Error during Sync: timeout.
[2012-06-19 19:22:49 - ddms] Removing req 0x4000002d from set
Sometimes (perhaps I do slightly different steps) I get:
[2012-06-16 14:20:02 - MyFirstApp02] Starting full Post Compiler.
[2012-06-16 14:20:02 - MyFirstApp02] ------------------------------
[2012-06-16 14:20:02 - MyFirstApp02] Android Launch!
[2012-06-16 14:20:02 - MyFirstApp02] adb is running normally.
[2012-06-16 14:20:02 - MyFirstApp02] Performing au.com.myorg.MyFirstApp02Activity activity launch
[2012-06-16 14:20:08 - MyFirstApp02] Launching a new emulator with Virtual Device 'jlbavd2_2'
[2012-06-16 14:20:17 - Emulator] bind: Unknown error
[2012-06-16 14:20:17 - MyFirstApp02] New emulator found: emulator-5556
[2012-06-16 14:20:17 - MyFirstApp02] Waiting for HOME ('android.process.acore') to be launched...
[2012-06-16 14:20:38 - MyFirstApp02] HOME is up on device 'emulator-5556'
[2012-06-16 14:20:38 - MyFirstApp02] Uploading MyFirstApp02.apk onto device 'emulator-5556'
[2012-06-16 14:20:50 - MyFirstApp02] Failed to install MyFirstApp02.apk on device 'emulator-5556': timeout
[2012-06-16 14:20:50 - MyFirstApp02] Launch canceled!
Note the "bind: Unknown error". Sometimes this error happens, sometimes it does not.
If I unplug my ethernet cable to my hardware router I get the following:
[2012-06-19 23:27:29 - MyApp] Android Launch!
[2012-06-19 23:27:29 - MyApp] adb is running normally.
[2012-06-19 23:27:29 - MyApp] Performing au.com.softmake.myapp.MyAppActivity activity launch
[2012-06-19 23:27:29 - MyApp] Refreshing resource folders.
[2012-06-19 23:27:29 - MyApp] Starting incremental Pre Compiler: Checking resource changes.
[2012-06-19 23:27:29 - MyApp] Nothing to pre compile!
[2012-06-19 23:27:33 - MyApp] Launching a new emulator with Virtual Device 'jlbavd'
[2012-06-19 23:27:40 - Emulator] Warning: No DNS servers found
[2012-06-19 23:27:44 - Emulator] emulator: emulator window was out of view and was recentered
[2012-06-19 23:27:44 - Emulator]
[2012-06-19 23:28:29 - MyApp] New emulator found: emulator-5554
[2012-06-19 23:28:29 - MyApp] Waiting for HOME ('android.process.acore') to be launched...
[2012-06-19 23:28:36 - MyApp] HOME is up on device 'emulator-5554'
[2012-06-19 23:28:36 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'
[2012-06-19 23:28:42 - MyApp] Failed to install MyApp.apk on device 'emulator-5554': timeout
[2012-06-19 23:28:42 - MyApp] Launch canceled!
Note the "Warning: No DNS servers found"
Using Eclipse to attempt to install an .apk to a physical device (rooted Samsung Galaxy S2. 4.0.3 with USB debugging enabled), and after going through similar steps as above, I get in the Eclipse console, Android Output:
[2012-06-15 22:40:34 - MyFirstApp] Starting full Post Compiler.
[2012-06-15 22:40:34 - MyFirstApp] ------------------------------
[2012-06-15 22:40:34 - MyFirstApp] Android Launch!
[2012-06-15 22:40:34 - MyFirstApp] adb is running normally.
[2012-06-15 22:40:34 - MyFirstApp] Performing
au.com.myorg.myfirstapp.MyFirstAppActivity activity launch
[2012-06-15 22:40:39 - MyFirstApp] Uploading MyFirstApp.apk onto device '0019adf659f24e'
[2012-06-15 22:40:51 - MyFirstApp] Failed to install MyFirstApp.apk on device '0019adf659f24e': timeout
[2012-06-15 22:40:51 - MyFirstApp] Launch canceled!
The same sort of error as when attempting to install to the emulator.
When using the command line only, and thereby avoiding Eclipse, I go through the following steps:
Open a windows command prompt in my working directory (I'm using C:\Data\Sda\Code\Mobile\Android\Examples>").
android list targets.
I obtain my target id (I choose Android 2.2).
android create project --target 3 --name MyAppCmd --path ./MyAppCmd --activity MyAppCmdActivity --package au.com.myorg.myappcmd
I get a series of healthy looking output "Created project directory ...", "Added file ..."
In windows I double click "AVD Manager.exe".
I launch my avd (which targets Android 2.2)
Back to my command window
cd MyAppCmd
ant debug
After a list of output I get "BUILD SUCCESSFUL ..." (On a prior occasion I had to edit C:\android\android-sdk\platform-tools\dx.bat to change "set defaultXmx=-Xmx1024M" to "set defaultMx=-Xmx512M" to make the build successful ). I observe that bin/MyAppCmd-debug.apk exists.
I attempt an install with
adb install bin/MyAppCmd-debug.apk
Output:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: device offline
adb devices
List of devices attached
emulator-5554 device
adb install bin/MyAppCmd-debug.apk
There is no further output in the command window. No error message. Just a blinking cursor, no error or success message, and no return to the command prompt ">".
I shut down the command line and open a new one.
I get the same result (a blinking cursor, etc.) if I try a push command (temp.txt has been previously created on my windows system) ...
adb push temp.txt /sdcard/temp.txt
Candidate solutions i've tried
Eclipse related:
Followed the steps from Eclipse isn't talking to the emulator
Increased the ADB connection time out. Eclipse > Window > Preferences > Android > DDMS > " ADB connection time out(ms):" = 10000 (I've also tried 60000).
Running the application twice (and choosing the currently running emulator or mobile phone again).
Cleaned my project: Eclipse > Project > Clean ...
Rebooted Eclipse.
Downgraded Eclipse from Indigo (2.7.x) to Helios (2.6.x).
Android related:
Reset the adb in several ways: "Reset ADB" command from the Eclipse DDMS perspective (from the Devices window triangle); command line with "adb kill-server" and "adb start-server"; and using the Windows Task manager to kill adb.exe.
Reinstalling my Samsung OEM USB drivers (By using KIES > Tools > Troubleshoot connection error).
Installing my Android SDK to a directory without spaces anywhere in the paths. Namely C:\Android\android-sdk. This entailed a reinstall of the SDK, formerly located at C:\Program files\Android\android-sdk
My Android Project is installed in a directory without spaces anywhere in the the path.
Deleting and recreating the avd (both from the Android AVD Manager and using Windows Explorer).
Using different AVDs that target different platfroms (Android 2.2 and Android 4.0.3).
Just after the Emulator opens but before it times out: unlocking the phone V waiting till it times out with the phone locked (in the emulator).
Verified I have in my AndroidManifest.xml:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
Environment related (PC and Phone):
Rebooted My Phone.
Rebooted my development PC.
Turning off my software and hardware firewall.
Turning of MS Security Essentials Real Time Protection.
Disabled my hosts list.
Reinstalled Java.
Booting into Windows safe mode and running Eclipse.
Manually killing most other application TCP/IP Processes (E.g GoogleDesk.exe, Apache Server PunkBuster, etc) by seeing what is available in Sysinternals TCPView.
Disconnected the Ethernet cable from my PC.
Other information
Some adb commands work.
For example the following makes the emulator screen dance about (as is expected).
adb shell monkey -v 100
I can list the devices, and correctly retrieve their state with
adb devices.
So there is partial communication between an adb client and adb daemon (via an adb server).
I am relatively new to Android development. However, I have successfully installed .apks to the emulator and my device about 6 months ago (from the WinXP PC I'm now trying to make work). I have ignored Android since then. When I came back to it recently I had some problem building my .apks which was fixed by deleting my debug.key and allowing eclipse to generate a new one.
In the intervening 6 months my development machine has changed in all sorts of ways. Installing new servers and apps, changing firewall settings etc. So there could well be some change I'm overlooking.
I also have a Win7 Laptop from which I have successfully installed .apks to the emulator and USB connected physical device. That is, I have a copy of the Android SDK, Eclipse, JAVA, etc installed on the Win7 machine. So I know I have a general handle on the correct procedure for setting it all up correctly.
I can install the .apk manually by double clicking the file through ES File Explorer from my Phone (which connects to my development machine wirelessly).
Final thoughts
It seems that there is some problem with the adb client, adb server, or adb daemon in talking to each other fully.
I have three hypothesis:
It is my fault. That there is some kind of TCP/IP conflict which breaks some of the connections between the adb client, adb server, or adb daemon. This is due to some freakish setting on my PC (like any developer I change various settings on my system all the time). However, I have tried disabling security and other potentially conflicting TCP/IP processes (as far as I can tell).
Some simple issue I keep overlooking.
It is google's/Android's fault. That is, there is a bug in the Android adb which requires an update to the android SDK platform tools. I think this less likely since I'd expect it to have surfaced by now.
Updates to post
2012-06-22 18:55 (UTC):
Complete reinstall (again) of Java, Eclipse, and the Android SDK with some variations in the install (e.g. Installed Java to root; Android SDK to the default "Program Files\"; and turning off all security software during install).
I note an error "Stopping ADB server failed (code -1)." in the Android SDK Manager Log during and install of the various parts of the platform/tools (via the Manager).
2012-06-30 06:15 (UTC):
Readjusted "My Environment" specs to reflect latest tests.
If its timeout then may be ADB connection with the eclipse will need more timeout limit. So Try this:
Prefrences>android>DDMS and you will see ADB connection timeout extend it to 20000
When this happen's to us on physical devices we usually attempt to fix it by unplugging, toggling "android debug mode" on the device and reconnecting.
Make sure your working on an ADMIN ACCOUNT. This problem also frustrated me, but when I switched over to an admin account (on Windows Vista), the adb seemed to correctly install the apk on the device.
I had the same issue; by copying the *.apk to the cell phone memory and installing it directly on the device (by Myfiles and selecting the *.apk), it worked OK. I suspect that there's an issue with the USB connection (too many errors, Eclipse is too slow due to other processes using the USB, etc.).
My simple approach is to just restart the emulator (not eclipse). It just works without me having to send any adb commands. Rarely happens with physical device though.
I've solved the problem, many months later, by upgrading to a completely new environment. Specifically, a new machine with a fresh install of Windows 8. I've also avoided installing the Comodo suite (I don't know that this was causing the problem).
So while this is not a direct solution to the problem (it's still not clear what was causing it) perhaps it might serve as another example where a workaround or lateral resolution to a problem is sometimes a good last resort option.
Try changing the ADB connection timeout. I think it defaults that to 5000ms and I changed mine to 10000ms to get rid of that problem.
If you are in Eclipse, you can do this by going through
Window-> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)
Try these...
Shut Down your eclipse.
Goto cmd and type:(I hope you have set the path of android tools folder in your path)
adb kill-server
adb start-server
output will be:
daemon not running. starting it now on port 5037
daemon started successfully
Start you Eclipse.
Start your emulator, if you are on physical device, see that your cable is not loose, and properly connected
I've got the same behavior as mentioned in your question, and tried every solution listed by you. Try this: change the USB port. For me, I have a total of 4 USB ports (two in front of my desktop and the two others in the back). The two ones on the front gives me [timeout install] whatever I do. The first one in the back I've tried has worked. I wonder it might be some issue related with USB port version, or MotherBoard embedded USB.
Just unplugging and plugging in the phone (physical) works. This does happen to me (too many times) when the phone is connected too long and nothing is done.
This is what I do on my Win7 64 bit system when this happens:
Close Eclipse
Kill adb.exe and all copies of emulator-arm.exe from task manager
Open Eclipse
Change to DDMS view and make sure you can see Devices
Open Window / ADV Manager
Select required emulator and press Start
Watch the Devices panel in DDMS, to see if the emulator shows.
If it doesn't display before the Start window progress bar has finished then the emulator isn't going to load this time so close the emulator.
Then repeat from 6.
For me the emulator never starts first time but 9 times out of 10 will start successfully on the second attempt.
Wish they'd fix this!
Mark
if you are not in admin account, make sure parental controls are turned off.It worked for me.
you could try this:
Open the "Android Virtual device Manager"
Select from one the listed devices there and run it.
Right your Android App -> Run As -> Android Application
It worked for me. I tried this on an emulator in eclipse.
It takes a while before the app is run. For me it took 33 seconds.
Wait until the message in the console says "Success!"
Related
I'm using Eclipse ADT plugin for android development. I came across some problems and I remove all my existing emulators and create a new one. when I run an android project and start the emulator, it just pop up and freezes with a black screen even before it start Android os.
and the progress tab shows,No operations to display at this time. and the logcat displaying I/ServiceManager(270): Waiting for service SurfaceFlinger... over and over again. And the console shows
[2013-12-02 14:54:03 - Emulator] emulator: warning: opening audio input failed
[2013-12-02 14:54:03 - Emulator]
[2013-12-02 14:54:04 - AndroidV4Virtusel] New emulator found: emulator-5554
[2013-12-02 14:54:04 - AndroidV4Virtusel] Waiting for HOME ('android.process.acore') to be launched...
But the emulator never launched. No rusalt although I restart the IDE.
when I restart the adb using DDMS perspective it gives following error.
[2013-12-02 15:22:50 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host
[2013-12-02 15:22:51 - DeviceMonitor] Connection attempts: 1
The avd manager also shows the emulator as a valid emulator
And when I close the emulator the console shows,
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get view server version from device emulator-5554
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get view server protocol version from device emulator-5554
[2013-12-02 15:34:23 - ViewServerDevice]Unable to debug device: My1 [emulator-5554]
[2013-12-02 15:34:23 - hierarchyviewer]Missing forwarded port for emulator-5554
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get the focused window from device emulator-5554
So can someone help me? Thank you!!!
To solve this, go to Window --> Open Perspective --> DDMS.
In the DDMS View, look for devices on the left of your screen. You should see a bar having about 12 icons. Click on the down arrow and click the "reset ADB". It should work afterwards.
In this case, I was able to run an emulator with Android 2.2. But unable to run an emulator in Android 4.2 which is my applications target. So i just removed Android 4.2 (API 17) and just reinstall it. Later on emulator starts fine. Thanks!!
I would suggest you to use the blue stacks as your emulator.. its really faster and efficient.. If you are using the Blue Stacks, first start your blue stacks and then eclipse or whatever the IDE you are using...
you can also have a look here
http://infopulseukraine.com/eng/blog/Software-Development/Mobile/Bluestacks_Eclipse/
As an extension to Jimi's answer, the easiest way to restart adb is to type the following command into a console window:
adb kill-server
If you get an error about adb command not found, then you can either add the android system tools path to your PATH key in environment variables, or just navigate to the tools directory and execute the command from there:
./AndroidSdk/platform-tools
After killing the server, make sure it's restarted correctly by typing:
adb devices
Which should show you a list of connected devices.
After restarting adb, the device manager should automatically refresh, otherwise try restarting device manager or selecting the refresh window button.
Maybe there is something wrong with your AVD properties,change it to where it compatible to your android projects,that's all.
I am developing an android app using Eclipse. All has been going well until I tried to deploy it to my device last night. When I clicked Run, I was presented with the following:
[2012-04-26 09:00:52 - Unicyclist] Android Launch!
[2012-04-26 09:00:52 - Unicyclist] adb is running normally.
[2012-04-26 09:00:52 - Unicyclist] Performing com.unicycle.UnicyclistActivity activity launch
[2012-04-26 09:00:52 - Unicyclist] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2012-04-26 09:01:05 - Unicyclist] Uploading Unicyclist.apk onto device 'SH0AZR805746'
[2012-04-26 09:01:05 - Unicyclist] Failed to install Unicyclist.apk on device 'SH0AZR805746': No such file or directory
[2012-04-26 09:01:05 - Unicyclist] com.android.ddmlib.SyncException: No such file or directory
[2012-04-26 09:01:05 - Unicyclist] Launch canceled!
It sounds like the directory it is attempting to install to on the phone is missing. Or perhaps it's a directory on my computer? I can't find anything on this by searching, and I'm not sure how to debug this.
This is a phone, not a virtual device.
The phone is running cyanogenmod, not stock.
A bunch of apps updated last night (related?) I re-imaged the phone from a backup, and the app deployed correctly. Then I updated the apps that had changed since last backup, and left it overnight. This morning, it won't deploy again (same problem)
The app launches fine on
another tablet, and fine in a virtual device
My dev environment is in a dropbox folder, if that makes any difference. I switch between developing on a windows and 2 linux computers.
Same problem occurs on both linux computers with this phone (haven't tried windows yet)
The problem is that Eclipse is not capable of finding your apk file. Just try build clean. Here is another similar question.
I have been working on fixing this for two days to no eval. Any Help would be much appreciated.
I have the following installed:
Eclipse
android-sdk-macosx
Android SDK Tools
Android 2.2 API 8
Android 2.3.3 API 10
I have a phonegap Project setup. Click "Run" -> "Run as" -> "Android Application"
In the console tap I see this:
[2011-12-14 10:47:38 - Foanar] ------------------------------
[2011-12-14 10:47:38 - Foanar] Android Launch!
[2011-12-14 10:47:38 - Foanar] adb is running normally.
[2011-12-14 10:47:38 - Foanar] Performing com.phonegap.foanar.App activity launch
[2011-12-14 10:47:38 - Foanar] Automatic Target Mode: launching new emulator with compatible
AVD '3DEVO'
[2011-12-14 10:47:38 - Foanar] Launching a new emulator with Virtual Device '3DEVO'
[2011-12-14 10:47:40 - Emulator] 2011-12-14 10:47:40.256 emulator-arm[3278:80b] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-12-14 10:47:40 - Emulator] emulator: WARNING: Unable to create sensors port: Connection refused
[2011-12-14 10:47:40 - Foanar] New emulator found: emulator-5554
[2011-12-14 10:47:40 - Foanar] Waiting for HOME ('android.process.acore') to be launched...
[2011-12-14 10:48:04 - Foanar] HOME is up on device 'emulator-5554'
[2011-12-14 10:48:04 - Foanar] Uploading Foanar.apk onto device 'emulator-5554'
[2011-12-14 10:48:05 - Foanar] Installing Foanar.apk...
The AVD "3DEVO" Launches but never installs the Foanar.apk. I never get any errors in LogCat or Console. Eclipse seems to hang here and go no further. I suspect it maybe has something to do with this line:
[2011-12-14 10:47:40 - Emulator] emulator: WARNING: Unable to create sensors port: Connection refused
I have been able to install the app via terminal using:
adb install /CapitalOnline/android/Foanar/bin/Foanar.apk
I would like to get Eclipse back up and working as terminal is ok but Eclipse is more convenient for testing builds directly from Eclipse. I used to be able to run this all the time. The only change to my machine outside of Eclipse that may or may not have anything to do with this... I installed AppMobi XDK and AppMobiPhoneGap XDK though my Chrome browser which creates its own dev environment in my user directory. Is it possible that in some way ports are crossing and refusing connections?
Thanks to anyone willing to help figure this out!
Once I came across this problem too. I don't remember exactly what I did to resolve it. I have had 2 emulator-related problems in that period and I found solutions for both of them, but now I can't remember which solution was for which problem :) So I'll suggest both methods.
Try cleaning the user data on your emulator. To do so, open your avd location (for me it was "C:\Users\UserName.android\avd") find your emulator (I guess it's 3DEVO.avd) and delete the files called "userdata.img" and "userdata-qemu.img".
While your program is running and stuck, open your Task Manager, go to processes and kill adb. Go back to Eclipse and run again. If there's an error about adb not launched, quit Eclipse and launch again.
Hope this will help.
killing adb from activity monitor fixed this for me.
if you have the device view open (windows > show views > other... > android > devices), you can choose downward arrow > reset adb
I am trying to learn about Android development. I have installed Eclipse (3.6.2) the ADT plugin (10.0.1) and the Android SDK (r11 off the official site) all are installed as 32 bit but my OS is Windows 7 64-bit.
What happens is I run my app (HelloAndroid) and the emulator and I see the main wallpaper screen but then then nothing happens! I have looked on the emulator for the app and cannot find it anywhere.
My console output is shown below...
[2011-05-20 19:14:20 - HelloAndroid] ------------------------------
[2011-05-20 19:14:20 - HelloAndroid] Android Launch!
[2011-05-20 19:14:20 - HelloAndroid] adb is running normally.
[2011-05-20 19:14:20 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-05-20 19:14:20 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'Android2.1'
[2011-05-20 19:14:20 - HelloAndroid] Launching a new emulator with Virtual Device 'Android2.1'
My AVD (Android Virtual Device) is set up as the tutorial suggests and the target is Android2.1-update1-API Level 7.
I have installed this app on my phone (HTC Hero, Android 2.1) and it works fine, but before I try and write other applications I need to get the emulator working, has anyone encountered this issue before?
I have looked online and cannot find a solution that solves my problem.
Thanks for your help in advance.
You can use adb to install your app. Find the bin directory in your eclipse workspace. There should be a YOUR_PROJECT_NAME.apk file there. To install it, from the command line, run:
adb install -r YOUR_PROJECT_NAME.apk
You will need adb in your path.
Start the emulator, switch to the logcat view in Eclipse (Window -> show view -> other ... -> logcat).
Clear the console output for logcat.
Try to deploy your application.
What does the output in logcat say? Does it display an error message?
I've been making some apps for android for quite a while but I've only been using windows 7. Due to some reasons sometimes I'm forced to program in linux so I followed the guide to configure the SDK and eclipse (http://developer.android.com/guide/developing/device.html).
After that I ran "adb devices" and got this:
List of devices attached
???????????? device
As you can see the name is unknown but this also happens in windows so I didn't fret too much over it.
Then I launched eclipse and made a very simple project to test the deployment but here two things happened:
1st- It doesn't detect the android SDK version. (http://img515.imageshack.us/img515/5611/escolha.jpg)
2nd- when I try to deploy I get the following output:
[2010-10-09 23:06:45 - testeAndroid] Android Launch!
[2010-10-09 23:06:45 - testeAndroid] adb is running normally.
[2010-10-09 23:06:45 - testeAndroid] Performing com.examples.teste.teste activity launch
[2010-10-09 23:06:45 - testeAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-10-09 23:09:50 - testeAndroid] WARNING: Unknown device API version!
[2010-10-09 23:09:50 - testeAndroid] Uploading testeAndroid.apk onto device '????????????'
[2010-10-09 23:09:50 - testeAndroid] Failed to upload testeAndroid.apk on device '????????????'
[2010-10-09 23:09:50 - testeAndroid] com.android.ddmlib.AdbCommandRejectedException: device not found
[2010-10-09 23:09:50 - testeAndroid] Launch canceled!
I'm using:
eclipse 3.5.2
adt 0.9.9
android SDK tools r7
android phone: vodafone 845 = Huawei U8120 - android 2.1-update1
Any idea for what is happening?
thanks in advance ;)
The Huawei U8120 (Vodafone 845) phone is one of those USB devices that present themselves as USB storage devices to the host operating system to serve up files for Windows driver installation. To switch them into the USB slave from Linux mode you need to use usb_modeswitch. You can download the latest usb_modeswitch package from the homepage, it includes support for your device. Or just use this call on the command line:
$ sudo usb_modeswitch -v 0x12d1 -p 0x1031 -s 20 -M "55534243123456780600000080000601000000000000000000000000000000"
However to use it with the Android tools you need to solve another problem, because the Huawei U8120 (Vodafone 845) provides no serial number. There might be other workarounds, but the one that made it work for me is a patch for the "adb" utility that can cope with devices that have no serial number.
$ ./tools/adb devices
List of devices attached
noserial-/dev/bus/usb/001/036 device
The patch is here: https://review.source.android.com/#change,13552 and here you can find an "adb" binary if you trust that source :) www.mediafire.com/?oizmyyw0wwz
see also http://code.google.com/p/android/issues/detail?id=4365
You have to update your udev rules according to the manual on http://developer.android.com/guide/developing/device.html - then it will work.
I have also android plataform and just a couple of days, an upgrade seemed to solve the problem. You have to make sudo usb_modeswitch -v 0x12d1 -p 0x1031 -s 20 -M "55534243123456780600000080000601000000000000000000000000000000" and the standard adb, as well the ADT plugin worked in ubuntu 10.04.
My adb version is 1.0.26 and the ADT plugin 10.0.0.v201102162101-104271, since the ADB upgrades forced me to update Eclipse plugin.