Debug mode vs. Release mode

by Brady » Fri, 04 Sep 2009 01:46:07 GMT

Sponsored Links
 Hi everyone,

I'm trying to figure out a way to programmatically determine if my
build was built in debug mode vs. release mode. I'd like to hide some
items in my settings screen if it's release.

When I build my app in Eclipse I'm building by default in Debug mode.
However, when I build the app using the command line, I build it in
release mode and sign the app using the jarsigner tool.

I've tried using
PackageInfo appInfo = manager.getPackageInfo("com.adobe.psmobile",
to test if
matches my debug signature and that didn't seem to work.

I'm now trying to see if I can introspect the app's KeyStore, to match
the default debug alias described here: 
of "androiddebugkey"

but I haven't figured out how to retrieve the app's KeyStore yet.

I'd greatly appreciate it if anyone had any suggestions on how to do
Thanks in advance!

Debug mode vs. Release mode

by Pieter » Fri, 04 Sep 2009 13:25:48 GMT

 Hello Brady,

I don't know if this is what you are looking for, but if you use
ant to build your release version you could use the following
public class Config {
        public static final String BUILD_NAME = "eclipse";

<target name="prepare-full">
  <property name="product" value="full" />

<target name="gather-sources">
<copy todir="${sources}">
  <fileset dir="${srcdir}">
    <include name="com/spectrekking/" />
  <filterset recurse="false" begintoken="BUILD_NAME = &quot;"
    <filter token="eclipse" value="BUILD_NAME = &quot;${product}

<target name="build-full" depends="prepare-full,gather-sources,..."/>

This will replace 'BUILD_NAME="eclipse";' with 'BUILD_NAME="full";' in during
a production build, allowing you to easily check the version. This
technique can then also
be used to differentiate between full and light builds (and in our
case the adc2 version).



Sponsored Links

Debug mode vs. Release mode

by Andrei » Sat, 05 Sep 2009 10:32:19 GMT

 how about android.util.Config.RELEASE?


Debug mode vs. Release mode

by Brady » Sun, 06 Sep 2009 08:26:13 GMT

 Hi Peter,

thank you for the suggestion. Yes we are using ant. We already use
some scripting like that to update a build java src. I'm not sure if
we'd add that to the build.xml (because it's autogenerated) but we
could update a static like you suggest.

Any ideas if we can compare the debug key vs. release?



Debug mode vs. Release mode

by Brady » Sun, 06 Sep 2009 08:29:17 GMT

 Sorry, I misspelled your name. Thank you Pieter!

Debug mode vs. Release mode

by Andrei » Sun, 06 Sep 2009 10:14:40 GMT

 can you use Config.DEBUG?


Other Threads

1. How to Querry Data base using cpp

Hi All,

I want to perform data base operation like reading from database and writing
to database from a CPP file.

Where can I find details on this.

Thanks in advance


2. Ensure ALSA Interface (Android side) is working.

I am getting some difficulties to make ALSA work on my Eee PC 701.
Firstly I would like to know if ALSA Android stuff (not low level) is
How to do that?

3. Porting Andorid for MIPS

4. Convert accelerometer readings to degrees

5. android:launchMode?

6. Running new provider in Open source Framework.

7. How stable is the KXML parser? What's your experience?