views:

128

answers:

4

I have installed the Android SDK and plugin for Eclipse and written my first test app. I am trying to view the device in the DDMS section of Eclipse, but my Android Virtual Machine is usually not listed in the Devices section when it is running. Occasionally it will appear for a minute only to disappear again. I found an article recommending that I run adb kill-server to get it to restart and appear. This works about 50% of the time, but the device just disappears again in 10-60 seconds.

My main desire with this is to push some files to the sd card on my Android Virtual Machine, but the device doesn't stay visible long enough to push any data to it.

Thanks!

A: 

It happens to me from time to time. I just reopen the emulator and it works.

If the AVD disappears very fast I would try pushing files using adb.

 adb push <local> <remote>    - copy file/dir to device
Macarse
Thanks for the feedback. I have reopened the emulator and eclipse several times and it still has the same issue. I even uninstalled eclipse and the android addons and the problem still isn't resolved. I will try pushing the files using adb though as a work around. Still would like the overall issue resolved though.
Ryan
A: 

I had similar problems with Eclipse launching my AVD's but them coming up disabled or offline. In Linux, I could see the process running, and "ADB Devices" reported that they were there, but offline. I would sometimes need to launch the AVD from the AVD Manager and select "clear user data". It would take a couple of rounds of this before my AVD would launch correctly, but the problem always returned. Something in my code was causing the AVD to get into a bad state and prevent it from launching cleanly.

I have since created a new project and started a new version of my app, and the problem has not returned.

Oldpond
A: 

Best I can come up with is to restart the adb server with adb kill-server; adb start-server . Blog post

I82Much
A: 

I have found that if my Android mobile is connected via USB then a running emulator may be hidden.

Alternatively, if you mean the devices list in Eclipse 'Run As' then it is possible the 'target version' of your android project in eclipse is set to a higher SDK version than the version of the emulator you would like to deploy to.

The 'target version' is set in 2 files, both of which can be viewed in the root of your eclipse project:

   default.properties
   AndroidManifest.xml

E.g. to include Android emulators from 1.6 upwards you should find the following in default.properties:

   target=android-4

and the following in AndroidManifest.xml

  <uses-sdk android:minSdkVersion="4"/>

To edit default.properties right-click the eclipse project/Properties/Android then select the lowest installed version of the Android SDK. To edit AndroidManifest.xml double-click on the xml file and on the first tab set the 'Uses SDK' 'Min SDK version' to 4.

Martin