Eclipse Android app: Run signed with real certificate

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

This question and answers originated from www.stackoverflow.com
Question by (4/14/2011 8:57:38 PM)

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.

Answer by

Find More Answers
Related Topics  android  eclipse  code-signing
Related Questions