有没有办法让run按钮使用真正的签名证书而不是调试证书?我想避免在安装开发副本之前从模拟器中卸载“共享用户”应用程序。
我已经知道我可以导出签名副本,但我更喜欢在Emulator上运行自动构建签名副本
发布于 2011-04-15 05:22:18
我假设您使用的是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>然后,可以在文件面板中展开build.xml,并将run-release目标添加到工具栏中。这至少会让安装从工具栏开始工作。
您需要设置适当的属性以使签名正常工作(key.store、key.store.password、key.alias、key.alias.password),如Building and Running from the Command Line中所述
希望这能有所帮助。
https://stackoverflow.com/questions/5669586
复制相似问题