在模拟器中安装应用程序,继续安装

发布于 2024-12-27 09:23:11 字数 1459 浏览 3 评论 0原文

我有这个应用程序。它在我的手机上运行良好,并且曾经在模拟器上运行良好。 但是当我将 Eclipse 更新到 Android API 15 时,麻烦就开始了。

如果我想在模拟器上运行我的应用程序,我会在控制台中得到以下输出

[2012-01-18 09:12:21 - ] Android 发布!
[2012-01-18 09:12:21 - ] adb运行正常
[2012-01-18 09:12:21 - ] 表演活动启动
[2012-01-18 09:12:26 - ] 上传 .apk 到设备“emulator-5554”
[2012-01-18 09:12:59 - ] 正在安装.apk...
清单

的顶部: <代码> [manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.visualreality.sportapp" android:screenOrientation="portrait" android:versionCode="3" android :版本名称=“1.2”] [使用-sdk android:minSdkVersion="8" /] [uses-permission android:name="android.permission.INTERNET"/] [uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /] [uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"][/uses-permission] [uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"][/uses-permission]
[uses-permission android:name="com.android.vending.CHECK_LICENSE" /]
(我将“<>”更改为“[]”,不知道如何使这些标签可见)

并且它继续安装。并且该应用程序将无法在我的模拟器上启动。 当我将 .apk 文件复制到手机时,它可以工作,因此我的代码中没有错误。

有人可以帮忙吗?

更新 在 Eclipse 中我构建了 .apk 文件。 然后我通过 de CMD 在模拟器中安装 apk 文件: 使用 /android-sdk-windows/platform-tools 中的 adb.exe

adb -s emulator-5554 install -r /path/to/your/apkfile.apk

之后,您可以从模拟器中的应用程序菜单运行该应用程序。

I have this app. It works fine on my phone and it used to work fine on the emulator.
But when I did an update of Eclipse to Android API 15, the trouble started.

If I want to run my app on the emulator i get the following output in my Console


[2012-01-18 09:12:21 - ] Android Launch!
[2012-01-18 09:12:21 - ] adb is running normally.
[2012-01-18 09:12:21 - ] Performing activity launch
[2012-01-18 09:12:26 - ] Uploading .apk onto device 'emulator-5554'
[2012-01-18 09:12:59 - ] Installing .apk...

the top part of the manifest:

[manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.visualreality.sportapp" android:screenOrientation="portrait" android:versionCode="3" android:versionName="1.2"]
[uses-sdk android:minSdkVersion="8" /]
[uses-permission android:name="android.permission.INTERNET"/]
[uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /]
[uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"][/uses-permission]
[uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"][/uses-permission]
[uses-permission android:name="com.android.vending.CHECK_LICENSE" /]


(i changed the "<>" to "[]", didn't know how to make those tags visible)

And it keeps installing. And the app will not start on my emulator.
when I copy the .apk file to my phone, it works, so no errors in my code.

Can someone help please?

update
In Eclipse I have build the .apk file.
I then install the apk file in the emulator via de CMD:
using the adb.exe in /android-sdk-windows/platform-tools


adb -s emulator-5554 install -r /path/to/your/apkfile.apk

After that you can run the application from the application menu in the emulator.

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

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

发布评论

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

评论(1

一个人的夜不怕黑 2025-01-03 09:23:11

首先,如果您还没有尝试过,请重新启动模拟器,我经历过安装过程有时会卡住。

其次,SDK 工具修订版 14 中的构建脚本发生了相当大的更改(更改日志),如果您从以前的版本更新,这可能会导致一些问题。您是在 Eclipse 内的模拟器上还是从命令行启动您的应用程序?

编辑:看起来你是从 eclipse 内部运行的。尝试从项目根目录(包含 build.xml)输入以下命令来从命令行启动:

ant 调试安装

如果这不起作用,您可能必须通过运行以下命令来手动升级项目:

免责声明: 通过执行以下操作,您可能会丢失对 build.xml 文件的所有自定义设置。请先备份您的项目!

android 更新项目 --path path_to_your_project

这将更新您的 build.xml 以及一些属性文件(如 ant.properties)以使用更新的构建过程。

First of all, restart the emulator if you haven't tried that, I've experienced that the install process gets stuck sometimes.

Second, there were pretty large changes made to the build scripts in revision 14 of the SDK tools (change log), this might cause some trouble if you updated from a previous version. Are you launching your app on the emulator inside Eclipse or from the command line?

Edit: looks like you're running from inside eclipse. Try launching from the command line by entering this command from your project root (which contains build.xml):

ant debug install

If this doesn't work, you might have to manually upgrade the project by running the following command:

DISCLAIMER: By doing the following you might lose any customizations to your build.xml file. Please backup your project first!

android update project --path path_to_your_project

This will update your build.xml along with some property files (like ant.properties) to work with the updated build process.

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