简体   繁体   English

是否可以在android / emulator上运行.apk文件?

[英]Is it possible to run the .apk file on android/emulator?

I got an APK from the Internet. 我从互联网上获得了一个APK。

Can I install and run the APK on the emulator? 我可以在模拟器上安装并运行APK吗?

If yes, how to do it? 如果是的话,该怎么办?

Use adb to install apk on emulator (or any connected device as well): 使用adb在模拟器(或任何连接的设备)上安装apk:

adb install file.apk

Re-install, keeping application data: 重新安装,保留应用程序数据:

adb install -r file.apk

adb documentation is available here: http://developer.android.com/tools/help/adb.html adb可以在此处找到adb文档: http//developer.android.com/tools/help/adb.html

Yes it is possible 对的,这是可能的

first copy that .apk file into "platform-tools" folder of your android-SDK then open the command prompt and go to "platform-tools" folder now type "adb install _ " here underline means your .apk file name. 首先将.apk文件复制到android-SDK的“ platform-tools”文件夹中,然后打开命令提示符并转到“ platform-tools”文件夹,现在键入“ adb install _ ”,此处下划线表示您的.apk文件名。 then press enter. 然后按Enter。 it's DONE 完成

Be sure that your emulator is running. 确保模拟器正在运行。

Yes you can. 是的你可以。

Easiest way is to download the apk file from within the browser on the emulator, then install it from the notifications menu. 最简单的方法是从模拟器上的浏览器中下载apk文件,然后从通知菜单进行安装。

Alternatively, you can install the Android SDK (which you might already have done if you have the emulator) and use adb install my.apk which should install to any available device (so long as only one is available). 或者,您可以安装Android SDK(如果您拥有模拟器,则可能已经完成),然后使用adb install my.apk安装到任何可用设备上(只要一个可用)。 Use adb devices to check what devices are available - when you run the emulator, it should show up there. 使用adb devices检查可用的设备-运行模拟器时,它应该显示在此处。

NB you will need to enable unknown sources in the applications menu of settings for this to work. 注意:您需要在应用程序的设置菜单中启用unknown sources ,此功能才能起作用。

将其放在主机中,然后从仿真器浏览器下载.apk文件。

Yes! 是!

Place your .apk file in the platform-tools folder of SDK , go to command prompt (path to ADB) and run the following command: 将您的.apk文件放置在SDKplatform-tools文件夹中,转到命令提示符(ADB的路径)并运行以下命令:

adb install your_apk_file.apk

I'm not sure if it will work, but try to open the File Explorer of the emulator through DDMS perspective in Eclipse, and copy/paste your apk in a folder. 我不确定它是否会起作用,但是尝试通过Eclipse中的DDMS透视图打开模拟器的文件资源管理器,然后将apk复制/粘贴到文件夹中。 Then navigate to that folder from your emulator and launch the apk. 然后从仿真器导航到该文件夹​​并启动apk。

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

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