我刚刚安装了整个 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);
}
}
我去尝试在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 }
只是,模拟器永远不会像指南所说的那样显示在我的屏幕上( http://developer.android.com/guide/tutorials/hello-world.html#run )
最佳答案
查看对我的问题的第一条评论:
自动目标模式:使用设备“015D7D330A028012”似乎表明它正在安装到 USB 连接的设备上,而不是启动模拟器。
– Christopher 8 月 26 日 19:17
关于Android 模拟器无法在 Eclipse 中启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3578586/