无法在模拟器中运行 Android 记事本练习 1

发布于 2024-10-15 04:43:36 字数 434 浏览 6 评论 0原文

昨天我尝试了记事本应用程序的练习 1,并完成了最后一个步骤的所有步骤 - 在模拟器中运行。

由于我是 Android 平台的新手,所以我不是菜鸟。我已经设置了我的 android 模拟器,拥有所有 SKD 等。项目是为 2.2 平台创建的,模拟器也是如此。

在我点击“运行方式”后 -> Android 应用程序模拟器启动,但它仅停留在主屏幕上(或关闭模拟器之前我所在的最后一个屏幕)。问题是我找不到这个记事本应用程序。我以为模拟器会在这个应用程序运行时启动,这样我就可以立即检查它。

我对清单 XML 不太了解,但是当查看它时,我发现注册了一个活动,所以我真的不知道问题是什么(或在哪里)。我在谷歌上搜索了一个小时,并尝试了在模拟器中运行某项时出现问题的每个链接,但没有结果......

所以我问你并希望有人能帮助我!

非常感谢!

shadyyx。

I got to try an exercise 1 of notepad application just yesterday and passed through all the steps to the last one - running in an emulator.

As I am new to Android platform, I'm not a noob. I have set my android emulator, have all the SKDs, etc. Project was created for 2.2 platform and so was the emulator.

After I hit Run As -> Android application the emulator starts, but it stays only on home screen (or last screen I was on before closing the emaulator). Problem is that I cannot find this notepad application. I thought that the emulator will start up with this app running so I could check it out immediately.

I do not know much about the manifest XMLs, but when looked in it I've found that there is an activity registered, so I really don't know what (or where) the problem is. I was googling for an hours and tried every link where a problem with running sth in emulator occured, but no result...

So I'm asking You and hope somebody will help me!

Many thanks in advance!!!

shadyyx.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别想她 2024-10-22 04:43:36

好吧,伙计们。

我真的很生气。昨天用谷歌搜索了4个小时,今天用了3个小时。
转到 Android 开发人员网站上的故障排除页面,我在其中找到了以下几点:

  1. 如果模拟器正在运行,请退出
  2. 检查所有模拟器进程是否已终止(有时它们可​​能会挂起,在 unix 或 mac 上使用 ps,或者在进程视图中使用任务管理器)视窗)。
  3. 退出 Eclipse
  4. 从命令行输入:
    adb Kill-server
  5. 启动 Eclipse 并重试

这不太准确,所以这里是对我有帮助的:
由于很明显 Eclipse 在启动后未与模拟器进行通信,因此我尝试了之前故障排除中的第 4 点 - 在 Eclipse 和模拟器都运行时运行“adb Kill-server”

当我回到 Eclipse 后,我可以在控制台中看到新的日志,通知我安装 .apk 并运行一些意图。切换回模拟器后,令人惊讶的是,应用程序就在那里并且正在运行!

当系统路径中没有 adb.exe 时,如何在 Windows 上运行命令的小提示:

打开 cmd.exe,找到并打开安装 Android SDK 的文件夹,然后浏览到文件夹 platform-tools。然后将文件adb.exe拖到cmd中,在adb.exe的路径后面写入参数kill-server并按Enter键。

现在的命令应该像我的示例一样(可能会根据您安装 SDK 的位置而有所不同):

"C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\adb.exe" kill-server

瞧 - 它应该完成!

希望您欣赏这一点,并且它将帮助许多其他面临与我相同问题的用户...

注意:如果杀死 adb 服务器后没有任何反应(最终您可以看到连接到 adb [模拟器] 的失败尝试)只需再次运行该项目(无需关闭模拟器!)。由于我在模拟器关闭后第一次运行项目时总是遇到这个问题,这总是对我有帮助!

OK guys.

I was really pissed off. Was googling for 4 hours yesterday, and 3 hours today.
Went to Troubleshooting page on android developers site, where I found these points:

  1. Quit the emulator if it is running
  2. Check that any emulator processes are killed (sometimes they can hang, use ps on unix or mac, or task manager in the process view on windows).
  3. Quit Eclipse
  4. From the command line, type:
    adb kill-server
  5. Start Eclipse and try again

This isn't quite accurate, so here is what helped me:
As it was obvious that Eclipse is not comunicating with the emulator after it starts, I tried just the point 4 from previous troubleshoot - run "adb kill-server" while both Eclipse and emulator were running.

After I got back to the Eclipse I could see new logs in console comming up infomring me of installing the .apk and running some intent. After switching back to the emulator, what a surprise, the application was there and running!!!

A small hint how to run a command on Windows when Yoou don't have adb.exe in Your system PATH:

Open up cmd.exe, find and open a folder where Your Android SDK is installed and browse to the folder platform-tools. Then drag the file adb.exe to the cmd, write the parameter kill-server after the path to the adb.exe and hit Enter.

command now should be as my example (could vary depending on where did You install Your SDK):

"C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\adb.exe" kill-server

And voila - it should be done!!!

Hope You appreciate this and that it will help many other users facing the same problem as I was...

Note: If there is nothing going on after killing of adb server (eventually You can see unsuccessful attempts to connect to adb [emulator]) just run the project again (without closing the emulator!). As I always have this problem when running a project for the first time after emulator was closed this always helps me!

明月松间行 2024-10-22 04:43:36

请尝试以下步骤。

1) 当模拟器启动并执行您之前的活动时,按住后退按钮直到看到主屏幕。

2)然后转到“应用程序”菜单并向下滚动以查看您的记事本应用程序。

如果在那里没有看到您的应用程序,请检查您的 logcat 输出。以下是检查方法。

i) 在 Eclipse 中,转到 Window->;显示视图->其他->安卓-> Logcat

在这里发布logcat的输出,以便我们可以帮助您。

Try these steps below.

1) When the Emulator starts up with your previous activity, keep pressing the back button till you see the Home Screen.

2) Then go to Applications menu and scroll down to see your notepad application.

If your application is not seen there, then check your logcat output. Here is how you check it.

i) In Eclipse go to Window-> Show View-> Other-> Android-> Logcat

Post the output of logcat here, so that we can help you out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文