如何在 Eclipse 中构建 APK 文件?

发布于 2024-10-10 09:01:24 字数 276 浏览 4 评论 0原文

当我使用 Eclipse 开发项目时,APK 文件将在模拟器上运行。但我想将我的应用程序上传到真实设备。有没有构建 APK 文件的工具?

流程是怎样的?或者可以从模拟器中提取APK文件吗?

When I develop the project using Eclipse, the APK file goes on the emulator. But I want to upload my application to a real device. Is there a tool to build an APK file?

What is the process? Or is it possible to pull the APK file from the emulator?

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

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

发布评论

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

评论(12

幼儿园老大 2024-10-17 09:01:24

当您在模拟器上运行项目时,会在 bin 目录中生成 APK 文件。请记住,仅构建项目(而不是运行)不会将APK文件输出到bin目录中。

When you run the project on the emulator, the APK file is generated in the bin directory. Keep in mind that just building the project (and not running it) will not output the APK file into the bin directory.

红颜悴 2024-10-17 09:01:24

要在设备上进行测试,您可以使用 USB 连接设备并从 Eclipse 运行就像一个模拟器一样。

如果您需要分发应用程序,请使用导出功能:

alt text

alt text

然后按照说明进行操作。您必须在此过程中创建一个密钥。

For testing on a device, you can connect the device using USB and run from Eclipse just as an emulator.

If you need to distribute the app, then use the export feature:

alt text

alt text

Then follow instructions. You will have to create a key in the process.

旧瑾黎汐 2024-10-17 09:01:24

如果您只想在设备上使用它,则无需创建密钥等。

使用 Eclipse:

要从 Eclipse 导出未签名的 .apk,请在 Package Explorer 中右键单击该项目,然后选择 Android Tools ->导出未签名的应用程序包。然后指定未签名的 .apk 的文件位置。

There is no need to create a key and so forth if you just want to play around with it on your device.

With Eclipse:

To export an unsigned .apk from Eclipse, right-click the project in the Package Explorer and select Android Tools -> Export Unsigned Application Package. Then specify the file location for the unsigned .apk.

小傻瓜 2024-10-17 09:01:24

APK 文件位于 /workspace/PROJECT_FOLDER/bin 目录中。要在真实设备中安装 APK 文件:

  1. 将真实设备与 PC/笔记本电脑连接。

  2. 使用终端或命令提示符转到sdk/tools/

  3. adb install <.APK 文件的文件路径>

就是这样...

The APK file is in the /workspace/PROJECT_FOLDER/bin directory. To install the APK file in a real device:

  1. Connect your real device with a PC/laptop.

  2. Go to sdk/tools/ using a terminal or command prompt.

  3. adb install <FILE PATH OF .APK FILE>

That's it...

满栀 2024-10-17 09:01:24

只需右键单击您的项目,然后转到

*导出 ->安卓->导出 Android 应用程序 -> YOUR_PROJECT_NAME ->创建新的密钥存储路径->填写详细信息->设置.apk位置->现在您可以获得 .apk 文件*

将其安装到您的手机中。

Just right click on your project and then go to

*Export -> Android -> Export Android Application -> YOUR_PROJECT_NAME -> Create new key store path -> Fill the detail -> Set the .apk location -> Now you can get your .apk file*

Install it in your mobile.

转角预定愛 2024-10-17 09:01:24

我们可以制作签名和未签名的 APK 文件。签名的 APK 文件可以安装在您的设备中。

要创建签名的 APK 文件:

  1. 在 Package Explorer 中右键单击该项目

  2. 选择Android Tools -> 导出签名的应用程序包

  3. 然后指定已签名的 .apk 的文件位置。

要创建未签名的 APK 文件:

  1. 在 Package Explorer 中右键单击项目

  2. 选择Android Tools -> 导出未签名的应用程序包

  3. 然后指定未签名 APK 文件的文件位置。

We can a make a signed and unsigned APK file. A signed APK file can install in your device.

For creating a signed APK file:

  1. Right-click the project in the Package Explorer

  2. Select Android Tools -> Export Signed Application Package.

  3. Then specify the file location for the signed .apk.

For creating an unsigned APK file:

  1. Right-click the project in the Package Explorer

  2. Select Android Tools -> Export Unsigned Application Package.

  3. Then specify the file location for the unsigned APK file.

彻夜缠绵 2024-10-17 09:01:24

当您运行应用程序时,应该检测到您的手机,并且您应该可以选择在手机上运行而不是在模拟器上运行。

有关识别手机的更多说明:http://developer.android.com/guide/developing/device.html< /a>

当您想要导出APK文件的签名版本(用于上传到市场或放在网站上)时,在Eclipse中右键单击该项目,选择“导出”,然后选择“导出Android应用程序”。

更多详细信息: http://developer.android.com/guide/publishing/app-signing.html #导出向导

When you run your application, your phone should be detected and you should be given the option to run on your phone instead of on the emulator.

More instructions on getting your phone recognized: http://developer.android.com/guide/developing/device.html

When you want to export a signed version of the APK file (for uploading to the market or putting on a website), right-click on the project in Eclipse, choose export, and then choose "Export Android Application".

More details: http://developer.android.com/guide/publishing/app-signing.html#ExportWizard

↘紸啶 2024-10-17 09:01:24

只要您保存任何源文件,bin/XXX.apk 文件就可以自动构建:

Window/Preferences、Android/Build,取消选中“跳过打包和索引...”

The bin/XXX.apk file can be built automatically as soon as you save any source file:

Window/Preferences, Android/Build, uncheck "skip packaging and indexing..."

两相知 2024-10-17 09:01:24

使用 Eclipse 和 ADT 创建签名/未签名 APK 的最简单方法如下:

  1. “Project Explorer”中右键单击您的项目,
  2. 将鼠标悬停在“Android Tools”上,
  3. 选择< strong>“导出签名的应用程序包”或“导出
    未签名的应用程序包”
  4. 选择新 APK 文件的位置,然后单击“保存”

    • 注意:如果您尝试构建用于测试版分发的 APK,您将
      可能需要创建一个签名包,这需要
      密钥库。如果您遵循 Eclipse 中的“签名应用程序”流程
      ADT 它将指导您完成创建新密钥库的过程。

希望这有帮助。

The simplest way to create signed/unsigned APKs using Eclipse and ADT is as follows:

  1. Right click your project in the "Project Explorer"
  2. Hover over "Android Tools"
  3. Select either "Export Signed Application Package" or "Export
    Unsigned Application Package"
  4. Select the location for the new APK file and click "Save".

    • NOTE: If you're trying to build a APK for beta distribution, you'll
      probably need to create a signed package, which requires a
      keystore. If you follow the "Signed Application" process in Eclipse
      ADT it will guide you through the process of creating a new keystore.

Hope this helps.

小忆控 2024-10-17 09:01:24

Eclipse 3.7(Indigo):
转到Windows ->首选项->安卓->构建并取消选中“跳过打包和德兴直到导出或启动”

此外,您还可以通过菜单 -> 手动构建它项目-> **取消选中“自动构建”**。

Eclipse 3.7 (Indigo):
Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch"

Also, you can build it manually via Menu -> Project -> **Uncheck "Build automatically"**.

在巴黎塔顶看东京樱花 2024-10-17 09:01:24

在Eclipse中右键单击该项目-> Android工具->无需签名密钥即可导出。连接您的设备。通过sdk/tools挂载它。

Right click on the project in Eclipse -> Android tools -> Export without signed key. Connect your device. Mount it by sdk/tools.

遮了一弯 2024-10-17 09:01:24

没有人提到这一点,但结合其他响应,您还可以通过将 apk 文件从 bin 目录放到您的手机或平板电脑上,只需将其放在网站上并下载即可。

下载后,您的设备会抱怨安装它。您的设备将建议您安装来自未知来源的程序的风险,并为您提供绕过建议的选项。

你的问题很具体。您不必从模拟器中提取它,只需从项目中的 bin 文件夹中获取 apk 文件并将其放置在您的真实设备上。

大多数人都会为您提供下一步的宝贵信息(签名和发布您的 apk),您不需要执行该步骤即可将其获取到您的真实设备上。

将其下载到您的真实设备是一个简单的方法。

No one mentioned this, but in conjunction to the other responses, you can also get the apk file from your bin directory to your phone or tablet by putting it on a web site and just downloading it.

Your device will complain about installing it after you download it. Your device will advise you or a risk of installing programs from unknown sources and give you the option to bypass the advice.

Your question is very specific. You don't have to pull it from your emulator, just grab the apk file from the bin folder in your project and place it on your real device.

Most people are giving you valuable information for the next step (signing and publishing your apk), you are not required to do that step to get it on your real device.

Downloading it to your real device is a simple method.

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