如何将 android 应用程序部署到设备?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3414424/
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 deploy android application to a device?
提问by Deepak
I developed an application. Now I want to deploy it on real device. Can any body please tell me the steps and the requirements to deploy it on a real device.
我开发了一个应用程序。现在我想在真实设备上部署它。任何机构都可以告诉我在真实设备上部署它的步骤和要求。
Thanks Deepak
谢谢迪帕克
回答by Hyman
There are multiple ways:
有多种方式:
- If you don't use eclipse, you can use adb tool.
adb -d install PATH_TO_YOUR_APK_FILE
- If you use eclipse, you can click run application in eclipse's launch menu. If this doesn't work, make sure you have "USB Debugging Mode" checked on your android phone. It's in the application menu.
- You can export your package and sign it! And then browse to it to install.
- 如果不使用 eclipse,可以使用 adb 工具。
adb -d install PATH_TO_YOUR_APK_FILE
- 如果您使用 eclipse,您可以在 eclipse 的启动菜单中单击运行应用程序。如果这不起作用,请确保您在 Android 手机上选中了“USB 调试模式”。它在应用程序菜单中。
- 您可以导出您的包裹并签名!然后浏览到它进行安装。
回答by NPike
I just copy the APK for my project out of the /workspace/project/bin folder, and use Dropbox to send it to my device. Then I install the APK from Dropbox client on the device. (No need for cables!)
我只是将项目的 APK 从 /workspace/project/bin 文件夹中复制出来,然后使用 Dropbox 将其发送到我的设备。然后我从设备上的 Dropbox 客户端安装 APK。(不需要电缆!)
回答by Benny Skogberg
Hook up your SmartPhone through USB-cable and set your phone i debug mode found in Settings > Applications > Development > USB debugging
. Next - run your project in eclipse and chose your device.
通过 USB 电缆连接您的智能手机并设置您的手机 i 调试模式Settings > Applications > Development > USB debugging
。接下来 - 在 Eclipse 中运行您的项目并选择您的设备。
make sure 'Run configurations' is set to manual, or this will fail if set to automatic and the target is a emulator. To change this behaviour, go to 'Run > Run configurations > Target' and set 'Deployment Target Selection Mode' to manual. Click 'Close' and try again.
确保“运行配置”设置为手动,否则如果设置为自动并且目标是模拟器,则会失败。要更改此行为,请转到“运行 > 运行配置 > 目标”并将“部署目标选择模式”设置为手动。单击“关闭”并重试。
回答by aspen100
FYI, if you're on a Galaxy Nexus, you need to fish around Samsung's website to find the driver installer. Here it is : http://www.samsung.com/us/support/owners/product/SCH-I515MSAVZW
仅供参考,如果您使用的是 Galaxy Nexus,则需要在三星的网站上搜索驱动程序安装程序。这是:http: //www.samsung.com/us/support/owners/product/SCH-I515MSAVZW
Note: If you're using adb -d install PATH_TO_YOUR_APK_FILEto install the apk on to your device, you will need to run it from the adt-bundle-[magic]/sdk/platform-tools/ folder.
注意:如果您使用 adb -d install PATH_TO_YOUR_APK_FILE将 apk 安装到您的设备上,则需要从 adt-bundle-[magic]/sdk/platform-tools/ 文件夹运行它。
Better yet, add adb.exeto your $PATH, and you can run adb from your windows command line/ terminal.
更好的是,将adb.exe添加到您的 $PATH,您可以从 Windows 命令行/终端运行 adb。
回答by JSS
Also, you have to set up your system to detect your device.
此外,您必须设置系统以检测您的设备。
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Linux see official Android guide here
如果您在 Windows 上开发,则需要为 adb 安装 USB 驱动程序。有关 OEM 驱动程序的安装指南和链接,请参阅OEM USB 驱动程序文档。
如果您在 Mac OS X 上开发,它就可以工作。跳过这一步。
如果您在 Linux 上进行开发,请参阅此处的官方 Android 指南