Android 如何将下载文件的 .apk 文件导入 Eclipse?我们有这个选择吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2827248/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:32:09  来源:igfitidea点击:

how can I import .apk file of the downloaded file into Eclipse? Do we have this option?

android

提问by Serenity

I am newb To Android.I just to check out few applications in my Desktop and have downloaded some sample applications. However, they are in the format .apk. Please let me know the procedure to import this file into Eclipse which helps me to run the application.

我是 Android 新手。我只是在我的桌面上查看一些应用程序并下载了一些示例应用程序。但是,它们采用 .apk 格式。请让我知道将这个文件导入 Eclipse 的过程,这有助于我运行应用程序。

Regards, Serenity.

问候,宁静。

回答by VenomVendor

If you want to test the downloaded *.apk try installing it in the emulator. Copy the APK file into platform-toolsdirectory, navigate to platform-toolsdirectory. Execute
adb install filename.apk
If you want to view the source code of the *.apk.
Try this link How to View the Source Code of an Android *.apk

如果您想测试下载的 *.apk,请尝试将其安装在模拟器中。将 APK 文件复制到platform-tools目录中,导航到platform-tools目录。执行
adb install filename.apk
如果要查看 *.apk 的源代码。
试试这个链接如何查看 Android *.apk 的源代码

回答by Cristian

You cannot "import" them to Eclipse as they are binary files. But, you can test the applications using the Android Virtual Device:

您不能将它们“导入”到 Eclipse,因为它们是二进制文件。但是,您可以使用 Android 虚拟设备测试应用程序:

http://developer.android.com/guide/developing/tools/avd.html

http://developer.android.com/guide/developing/tools/avd.html

In order to use it you will have to install the Android SDK and configure a Virtual Device:

为了使用它,您必须安装 Android SDK 并配置一个虚拟设备:

http://developer.android.com/sdk/index.html

http://developer.android.com/sdk/index.html

Once you have installed and configured the virtual device, you just have to install you aplications using the adbtool:

安装和配置虚拟设备后,您只需使用该adb工具安装应用程序:

adb install applicacion.apk

adb install applicacion.apk

回答by user3506219

If adb complains you have multiple devices, do

如果 adb 抱怨您有多个设备,请执行

adb devices

Notice the serial number of the one you want, and then

注意你想要的序列号,然后

adb -s SERIAL -r filename.apk

回答by Bay

Also, if you are using WinRAR or other zipping programmes, right click on the .apk file with your mouse and open with winrar/winzip/e.t.c. then surf to the .xml files then edit them via notepad easily.

此外,如果您正在使用 WinRAR 或其他压缩程序,请用鼠标右键单击 .apk 文件并使用 winrar/winzip/etc 打开,然后浏览 .xml 文件,然后通过记事本轻松编辑它们。

回答by Bay

If you wanna run the application you don't have to import it into Eclipse but instead you have to install it on your phone.

如果您想运行该应用程序,则不必将其导入 Eclipse,而是必须将其安装在您的手机上。

If you wanna see the source code of the apk file, you need a decompiler. There are some available in the Internet, however, all of them I have seen doesn't work 100% (e.g. they can extract the resources but not the *.java files, and so on)...

如果你想看到 apk 文件的源代码,你需要一个反编译器。互联网上有一些可用的,但是,我所看到的所有这些都不能 100% 工作(例如,它们可以提取资源但不能提取 *.java 文件,等等)...

But you have to note that using decompilers could not be legal in some cases

但是你必须注意,在某些情况下使用反编译器是不合法的

回答by user2662762

File -> Import -> Android Code into Workspace -> (Select Root Directory (folder) of the Application you are importing) -> Check the (Copy projects into workspace [checkbox]) -> Click Finish [En Twitter puedes preguntar][DS]

文件 -> 导入 -> Android 代码到工作区 ->(选择您要导入的应用程序的根目录(文件夹))-> 选中(将项目复制到工作区 [复选框]) -> 单击完成 [En Twitter puedes preguntar][ [DS]

回答by user2301336

If you want to test the downloaded *.apk in the Emulator --> install it in the emulator.

如果要在模拟器中测试下载的 *.apk --> 将其安装在模拟器中。

How to install .apk file into Emulator?

如何将 .apk 文件安装到模拟器中?

Ans:Copy the *.apk file into SDK->platform-tools directory (where you'll find adb.exe file),

Ans:将 *.apk 文件复制到 SDK->platform-tools 目录(您将在其中找到 adb.exe 文件),

navigate to that directory through command line on your windows PC.

通过 Windows PC 上的命令行导航到该目录。

And then Execute:-

然后执行:-

adb install filename.apk

adb 安装文件名.apk

If you want to view the source code of the *.apk.

如果要查看*.apk 的源代码。

Try this link How to View the Source Code of an Android *.apk

试试这个链接如何查看 Android *.apk 的源代码

回答by Moxet Jan

Compress .apk with winrar, open it in winrar and click on apk file. It will show the content just click on extract. Now you have a complete directory structure of a source file. Try to repeat the import steps as suggested above.

使用winrar 压缩.apk,在winrar 中打开它并单击apk 文件。它会显示内容,只需点击提取。现在您有了一个完整的源文件目录结构。尝试按照上面的建议重复导入步骤。