简体   繁体   English

可以通过 USB 电缆从 Android Studio 发送“发布”版本吗?

[英]Possible to send “release” build, over USB cable, from Android Studio?

Using Android Studio 0.6.1 (actually on OSX), normally I have build variant set on "debug".使用 Android Studio 0.6.1(实际上在 OSX 上),通常我在“调试”上设置了构建变体。

在此处输入图片说明

I have a phone plugged in "Connected as a media device".我有一部电话插入“作为媒体设备连接”。 I click the "Run" button up top.我单击顶部的“运行”按钮。

在此处输入图片说明

Everything works fantastically well.一切都非常好。

However.然而。 Say I change this to "release" ...假设我将其更改为“发布”...

在此处输入图片说明

it seems impossible, to now send it over the USB to the phone?似乎不可能,现在通过 USB 将其发送到手机?

I understand that to publish to the playstore, I use "release" and use "build signed apk", using the password for the keystone.我知道要发布到 Playstore,我使用“发布”并使用“构建签名的 apk”,使用 keystone 的密码。 That works perfectly.这完美地工作。

SoBut can I just "leave it on" "release" mode while working with the tethered phones? SoBut 我可以在使用系留电话时“保持开启”“释放”模式吗?

(With iOS development for example, the "debug" setting is just annoying and sucks, and you can just leave it on "release" all the time, basically. Indeed you can just delete the "debug" variant.) (以 iOS 开发为例,“调试”设置很烦人而且很糟糕,基本上你可以一直把它放在“发布”上。实际上你可以删除“调试”变体。)

thanks, Android aces!!谢谢,安卓王牌!!


Here's the error that appears if you try to send a "release" build over the USB cable to a tethered phone.如果您尝试通过 USB 电缆将“发布”版本发送到系留电话,则会出现以下错误。

在此处输入图片说明

The Android system requires that all installed applications be digitally signed with a certificate whose private key is held by the application's developer. Android 系统要求所有已安装的应用程序都使用证书进行 数字签名,该证书的私钥由应用程序开发人员持有。

Have you set up a key-store for signing the release build?您是否设置了用于签署发布版本的密钥库

for details using gradle see how-to-create-a-release-signed-apk-file-using-gradle有关使用 gradle 的详细信息,请参阅how-to-create-a-release-signed-apk-file-using-gradle

With android studio 0.5.9 you can use Module settings [F4]/app signing to define the key store.使用 android studio 0.5.9,您可以使用Module settings [F4]/app signing来定义密钥库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有可能通过 usb 电缆访问胡椒平板电脑,或者有一种方法可以尽快从 Android Studio 构建应用程序吗? - There is a possibility to access pepper tablet via usb cable or a way to build the app from Android Studio as fast as possible? 如何通过USB电缆从Android应用程序访问tomcat服务器? - how to access tomcat server from android app over usb cable? 通过 USB 电缆进行 PC 到 Android 通信 - PC to Android communication over USB cable 使用USB电缆将数据(文本行)从计算机发送到我的Android应用程序 - send data (text lines) from computer to my android application with usb cable 如何从Android 4.2.2设备向LED发送信号? (Eclipse和USB电缆) - How can I send a signal to LEDs from my Android 4.2.2 device? (Eclipse & USB cable) 通过USB电缆将条形码从android应用发送到C#桌面应用 - Send Bar code from android app to C# desktop application via usb cable Android应用程序通过USB电缆的数据引脚发送信号 - android app to send a signal through the data pin of the usb cable 如何通过USB通过Windows将命令从Android发送到PC - How to send commands from android to pc with windows over USB 如何通过 USB 连接从安卓设备发送 .proto 文件 - How to send .proto files from android device over USB connection 通过OTG线缆从USB设备向Android平板电脑提供电源 - Drawing power from USB device to android tablet through OTG cable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM