Android 如何使用 .apk 文件制作 EXE 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2866924/
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
How to make an EXE file using .apk file
提问by rob
am almost done with my project in android, now I want to make the executable version of the application.
我在android中的项目快完成了,现在我想制作应用程序的可执行版本。
I need to demonstrate it in .exe form as soft app as on emulator, not by built and debug process from eclipse.
我需要将它以 .exe 形式作为软应用程序在模拟器上进行演示,而不是通过 eclipse 的构建和调试过程进行演示。
回答by Cratig
what the op is asking for is simple - he wants to create a MS Windows program file that runs just like the APK he's made.
op 的要求很简单——他想创建一个 MS Windows 程序文件,它的运行方式与他制作的 APK 一样。
Unfortunately this cannot be done. The only way to 'show off' your program is as people have stated:
不幸的是,这是无法做到的。正如人们所说,“炫耀”您的程序的唯一方法是:
- Through the emulator on Windows
- On an acual device (Once installed, you can disconnect the device from the computer and use it like a normal app)
- 通过 Windows 上的模拟器
- 在实际设备上(安装后,您可以断开设备与计算机的连接并像普通应用程序一样使用它)
回答by Rolf ツ
When I have a client that want's to show an app, at conference for example, I always use Bluestacks it's not perfect but it allows you to run android apps on your computer without doing all the technical stuff (like installing an emulator etc).
当我有一个客户想要展示一个应用程序时,例如在会议上,我总是使用 Bluestacks,它并不完美,但它允许您在计算机上运行 android 应用程序,而无需执行所有技术工作(例如安装模拟器等)。
To install an app on your you computer using the Bluestacks device/emulator you simply click on the apk.
要使用 Bluestacks 设备/模拟器在您的计算机上安装应用程序,您只需单击 apk。
回答by Steve Haley
You can't convert an APK file into a .exe file. APK files hold Android apps as self-installable files already - opening an APK file on a phone or the emulator will start the installation process. It sounds like you just want to sign the app with a 'proper' key rather than using a debug key. To do that, read the official page on signing apps.
您无法将 APK 文件转换为 .exe 文件。APK 文件已将 Android 应用程序作为可自行安装的文件保存 - 在手机或模拟器上打开 APK 文件将开始安装过程。听起来您只想使用“正确”密钥而不是调试密钥来签署应用程序。为此,请阅读有关签署应用程序的官方页面。
回答by Cristian
You don't need to create a .EXE file for doing what you want. You can just create a bat file that executes adb
commands that will: install and start your application in the emulator. I guess, the problem here is that you don't understand how the APK files work... I'm just saying.
您不需要创建 .EXE 文件来执行您想要的操作。您可以创建一个 bat 文件来执行以下adb
命令: 在模拟器中安装和启动您的应用程序。我想,这里的问题是你不了解 APK 文件是如何工作的......我只是说。
OK... in order to install an Android application using adb
(which is basically what Eclipse does in the background) you need to do this:
好的...为了使用adb
(这基本上是 Eclipse 在后台执行的操作)安装 Android 应用程序,您需要执行以下操作:
adb install path/name_app.apk
Then, you can start the application by using adb shell am
command. You can find info here: http://pdk.android.com/online-pdk/guide/instrumentation_testing.html
然后,您可以使用adb shell am
命令启动应用程序。你可以在这里找到信息:http: //pdk.android.com/online-pdk/guide/instrumentation_testing.html
Another thing you have to take in account is that you will have to run the AVD before installing and executing your application: http://developer.android.com/guide/developing/tools/avd.html
您必须考虑的另一件事是您必须在安装和执行应用程序之前运行 AVD:http: //developer.android.com/guide/developing/tools/avd.html
All those commands you have to execute (may be using a .bat file as I mentioned before) are executables that you can find in the android-sdk\tools directory.
您必须执行的所有命令(可能使用我之前提到的 .bat 文件)都是可以在 android-sdk\tools 目录中找到的可执行文件。
回答by Pir Fahim Shah
Once you create a project/application in Eclipse
then along with this you also have created the .apk
file. Android can run .apk
files, so go to the place where your project have been saved and open it, like this Open Project -->bin-->.apk
.
一旦你创建了一个项目/应用程序,Eclipse
那么你也创建了这个.apk
文件。Android 可以运行.apk
文件,所以到你的项目保存的地方打开它,像这样Open Project -->bin-->.apk
。
Now send the .apk
file to your android phone through Bluetooth or copy it.
现在.apk
通过蓝牙将文件发送到您的安卓手机或复制它。