Android 如何使用 Eclipse 将 .apk 文件传输到设备
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3697653/
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 do I transfer .apk files to device using Eclipse
提问by zipzit
Gotta problem. My employer won't allow anybody access to run / line command tools on our computers. No way to run ADB (Android Debug Bridge) without that control. I'm using windows, no way to access the registry, no way to manually add cmd.exe, i've tried..) Screwing the staff is a sure way to reduce IT costs though, sigh.
一定有问题 我的雇主不允许任何人访问我们计算机上的运行/行命令工具。没有这种控制,就无法运行 ADB(Android 调试桥)。我正在使用 Windows,无法访问注册表,无法手动添加 cmd.exe,我已经尝试过..) 不过,减少 IT 成本确实是一种降低 IT 成本的方法,叹气。
I notice that sometimes when testing thru Eclipse with a real device plugged in via USB, that the application shows up on my android device.. and other times not.
我注意到有时在使用通过 USB 插入的真实设备通过 Eclipse 进行测试时,该应用程序显示在我的 android 设备上......而其他时候则没有。
Is there any way to use the Eclipse tools with Android plug in to 'install' the applications that I'm writing onto my real, physical device? They test fine as long as I'm USB plugged in. but don't remain after I disconnect.
有什么方法可以使用带有 Android 插件的 Eclipse 工具来“安装”我在真实物理设备上编写的应用程序?只要我插入 USB,它们就可以正常测试。但在我断开连接后不要保持。
I know, getting a new employer is probably the best answer here, but that's not in the cards right now. Good suggestion though : )
我知道,找一个新雇主可能是这里最好的答案,但现在还没有考虑。不过建议不错:)
Anyone know of a work around for program installation to hardware?
任何人都知道将程序安装到硬件的解决方法?
Many thanks in advance, zip
非常感谢提前,zip
回答by hackbod
You really shouldn't need to do anything special. When you run an app from Eclipse, whether you are running it on the emulator or a device, it just uses adb to install it. If you disconnect from your computer at that point, it will remain. It is installed. There isn't a special "app running but not installed" state.
你真的不需要做任何特别的事情。当您从 Eclipse 运行应用程序时,无论您是在模拟器还是设备上运行它,它都只使用 adb 来安装它。如果您当时与计算机断开连接,它将保留。它已安装。没有特殊的“应用程序正在运行但未安装”状态。
I'd be really curious to know in what situations you are finding your up uninstalled.
我真的很想知道你在什么情况下发现你的 up 被卸载了。
回答by ShadowGod
回答by steve
- Copy the .apk from
/bin/res
to, say, the desktop (or a desired folder in DropBox if you have it) - Hook your phone up via USB and make it a storage device (ie: flash drive).
- Drag the file in, double click on it and choose install
- 将 .apk 从
/bin/res
桌面复制到桌面(或 DropBox 中的所需文件夹,如果有的话) - 通过 USB 连接您的手机并使其成为存储设备(即:闪存驱动器)。
- 将文件拖进去,双击它并选择安装
I have 3 android phones, one Android 2.1 and two with ICS, and they aren't all recognized the standard way.
我有 3 部 Android 手机,一部是 Android 2.1,两部是 ICS,但它们并非都以标准方式被识别。
回答by nicholas.hauschild
You can mount your device's filesystem when plugged in via USB. From here, copy the .apk from your development computer to a location on the sdcard. Finally, get a free app like Astro File Manager or AndroZip to find the .apk on your device's filesystem. Once you select the .apk, you should be prompted with how you want to open it. If you open it with the app manager, you can install/uninstall it on the device.
通过 USB 插入时,您可以挂载设备的文件系统。从这里,将 .apk 从您的开发计算机复制到 SD 卡上的某个位置。最后,获取 Astro File Manager 或 AndroZip 等免费应用程序,以在您设备的文件系统中查找 .apk。选择 .apk 后,系统会提示您如何打开它。如果您使用应用程序管理器打开它,您可以在设备上安装/卸载它。
回答by omermuhammed
Another way is to load the apk onto an SD card, through a PC's USB port, then plug in that SD card into the handset (most android phones have micro SD card support). Now launch the apk and install it from there.
另一种方法是通过 PC 的 USB 端口将 apk 加载到 SD 卡上,然后将该 SD 卡插入手机(大多数安卓手机都支持 micro SD 卡)。现在启动apk并从那里安装它。
回答by Erol
When your device is connected to your PC via the USB debug cable, go to Eclipse. While your application project is open, select Run from upper menu. Then select your device from the window and run. This should be enough to load your application to your device. Now, even when you disconnect the USB cable, the application should be there.
当您的设备通过 USB 调试电缆连接到您的 PC 时,转到 Eclipse。当您的应用程序项目打开时,从上方菜单中选择运行。然后从窗口中选择您的设备并运行。这应该足以将您的应用程序加载到您的设备上。现在,即使您断开 USB 电缆的连接,应用程序也应该在那里。