Eclipse Android app: Run signed with real certificate
العربية
български
català
中文
čeština
dansk
Nederlands
eesti
suomi
français
Deutsch
Ελληνικά
עברית
हिंदी
magyar
Bahasa Indonesia
italiano
日本語
한국어
latviešu
lietuvių
norsk
polski
Português
română
русский
slovenčina
slovenski
español
svenska
ไทย
Türkçe
українська
Tiếng Việt
Is there a way I can get the run button to use the real signing certificate instead of a debug one? I want to avoid having to uninstall the "shared user" apps from the emulator before installing the development copy.
I am already aware I can export a signed copy, but I would prefer to have an automated Build Signed Copy / Run On Emulator
Answer |
I'm assuming you're using Eclipse.
First, add Ant support to your project, by running "android update project -p ." inside the project dir.
Next, create custom targets in your build.xml, along the lines (typed not tested) of:
<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>
You can then expand the build.xml in the files panel, and add the run-release target to your toolbar. This will at least get the install working from the toolbar.
You'll need to set appropriate properties to get signing working (key.store, key.store.password, key.alias, key.alias.password), as described in Building and Running from the Command Line
Hope this helps.