Eclipse Android应用程序:使用真实证书运行签名

Bry*_*eld 6 eclipse android code-signing

有没有办法让运行按钮使用真正的签名证书而不是调试证书?我想避免在安装开发副本之前从模拟器中卸载"共享用户"应用程序.

我已经知道我可以导出已签名的副本,但我更希望有一个自动的Build Signed Copy/Run On Emulator

Phi*_*llo 0

我假设您正在使用 Eclipse。

首先,通过运行“android update project -p”向您的项目添加 Ant 支持。在项目目录内。

接下来,在 build.xml 中创建自定义目标,如下所示(键入未测试):

<target name="install-release" depends="release">
    <sequential>
        <echo>Installing ${out.release.file} onto default emulator or device...</echo>
        <exec executable="${adb}" failonerror="true">
            <arg line="${adb.device.arg}" />
            <arg value="install" />
            <arg value="-r" />
            <arg path="${out.release.file}" />
        </exec>
    </sequential>
</target>

<target name="run-release" depends="install-release">
    <!-- not sure what goes here -->
</target>
Run Code Online (Sandbox Code Playgroud)

然后,您可以在文件面板中展开 build.xml,并将运行发布目标添加到工具栏。这至少可以让安装从工具栏开始工作。

您需要设置适当的属性才能进行签名(key.store、key.store.password、key.alias、key.alias.password),如从命令行构建和运行中所述

希望这可以帮助。