简体   繁体   English

在Android模拟器中安装.apk时出错

[英]error installing .apk in android emulator

I'm new to android development. 我是android开发的新手。 I've installed eclipse and updated all the android packages. 我已经安装了eclipse并更新了所有android软件包。 Now i'm trying to run the .apk file that was provided by my app developer to test it in the emulator. 现在,我正在尝试运行由我的应用程序开发人员提供的.apk文件,以便在模拟器中对其进行测试。

I'm installing it via a download from the web. 我正在通过网络下载进行安装。 Once the package is downloaded, when I click on it, it says "installing". 软件包下载后,当我单击它时,它会显示“正在安装”。 Then it says Not Installed. 然后说未安装。 The app runs fine on my phone. 该应用程序可以在我的手机上正常运行。 But I want to test it with different screen resolutions and sizes, screen captures etc. 但是我想用不同的屏幕分辨率和大小,屏幕截图等进行测试。

I've tried it with several different emulators from 2.3 to 4.0, and I get the same error. 我已经尝试使用2.3至4.0的几种不同的模拟器,但得到了相同的错误。
I'm running eclipse on a mac. 我在Mac上运行Eclipse。

If you are downloading the apk inside the emulator and then attempting to directly install it inside the emulator, that may be the problem as the emulator does not include the Android Market (now Google Play). 如果要在模拟器中下载apk,然后尝试将其直接安装在模拟器中,则可能是问题所在,因为模拟器不包括Android Market(现在为Google Play)。

Download the apk on your Mac first, and then install using adb as follows: 首先在Mac上下载apk,然后使用adb进行安装,如下所示:

adb install <apk_file>

After uninstalling the app from the emulator, Open a terminal and to the directory where you installed android-sdk, then go to platform-tools. 从模拟器卸载应用程序后,打开终端并转到安装android-sdk的目录,然后转到platform-tools。 Give command adb install yourAppName.apk Post the error log if this fails. 给命令adb install yourAppName.apk如果失败,则发布错误日志。 (To view the error log, open another terminal and go to android-sdk-installation directory > platform-tools, give command adb logcat . Keep the log running while the apk is installing.) (要查看错误日志,请打开另一个终端,然后转到android-sdk-installation目录> platform-tools,提供命令adb logcat 。在安装apk时保持日志运行。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM