Android 模拟器无法在 Eclipse 中启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3578586/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android emulator does not start in eclipse
提问by Mala
I just installed the whole shebang in order to develop android apps in Eclipse (I'm running 64-bit gentoo). Everything seems to go fine, and I created the dev group's hello-world example:
我刚刚安装了整个 shebang,以便在 Eclipse 中开发 android 应用程序(我正在运行 64 位 gentoo)。一切似乎都很顺利,我创建了开发组的 hello-world 示例:
package com.nfshost.flyingmonkey.android;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
I go to try and run it in eclipse, and according to the console it seems to work:
我去尝试在 eclipse 中运行它,根据控制台它似乎可以工作:
[2010-08-26 14:03:18 - HelloAndroid] ------------------------------
[2010-08-26 14:03:18 - HelloAndroid] Android Launch!
[2010-08-26 14:03:18 - HelloAndroid] adb is running normally.
[2010-08-26 14:03:18 - HelloAndroid] Performing com.nfshost.flyingmonkey.android.HelloAndroid activity launch
[2010-08-26 14:03:18 - HelloAndroid] Automatic Target Mode: using device '015D7D330A028012'
[2010-08-26 14:03:18 - HelloAndroid] Uploading HelloAndroid.apk onto device '015D7D330A028012'
[2010-08-26 14:03:18 - HelloAndroid] Installing HelloAndroid.apk...
[2010-08-26 14:03:20 - HelloAndroid] Success!
[2010-08-26 14:03:20 - HelloAndroid] Starting activity com.nfshost.flyingmonkey.android.HelloAndroid on device
[2010-08-26 14:03:21 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.nfshost.flyingmonkey.android/.HelloAndroid }
Only, the emulator never shows up on my screen like the guide says it will (http://developer.android.com/guide/tutorials/hello-world.html#run)
只是,模拟器永远不会像指南说的那样出现在我的屏幕上(http://developer.android.com/guide/tutorials/hello-world.html#run)
回答by Mala
See first comment to my question:
请参阅对我的问题的第一条评论:
Automatic Target Mode: using device '015D7D330A028012' seems to suggest it's installing onto a USB-attached device, rather than firing up an emulator.
– Christopher Aug 26 at 19:17
Automatic Target Mode: using device '015D7D330A028012' seems to suggest it's installing onto a USB-attached device, rather than firing up an emulator.
– 克里斯托弗 8 月 26 日 19:17
回答by Arunabh Das
Go to Window -> Android SDK and AVD Manager -> Virtual Device and create a New Virtual Device there (Remember to specify the correct target API level for that device). If that virtual device is an accepted virtual device, the app will fire off that device when you run the app.
转到 Window -> Android SDK and AVD Manager -> Virtual Device 并在那里创建一个新的虚拟设备(记住为该设备指定正确的目标 API 级别)。如果该虚拟设备是可接受的虚拟设备,则当您运行该应用程序时,该应用程序将关闭该设备。
回答by user2266928
i was facing the sAMe issue go ro run the select run configuration browse your project select android a new configuration open then select run..
我面临着同样的问题去运行选择运行配置浏览你的项目选择android一个新的配置打开然后选择运行..
it was working for me..
它对我有用..
回答by user2266928
sorry for above answer i just do it as like this.. open cmd promt.. go to that directory in which my sdk was extraxted i go to tool subdriectory then run android.bat file by just simply put the name android.bat in that file..
抱歉上面的答案我只是这样做.. 打开 cmd promt.. 转到我的 sdk 被提取的那个目录我转到工具子目录然后运行 android.bat 文件,只需在其中输入名称 android.bat文件..