简体   繁体   中英

Android Instrumentation Test concerns: debug vs. release mode

To automate tests, we are considering the Android instrumentation tests. However, we are concerning the performance may differ significantly if the unit tests are put in the debug mode. After doing some search, there seems no definitive answers. Thus, we need some clarifications about the following points.

  1. Does Eclipse/ADT compile the project using the same compiler optimization options whether it is in debug or release mode?

  2. the apk generated by Eclipse/ADT is always in debug mode (whatever "run as" or "debug as"). The suggested way to build the release version is through the export wizard. The only difference is the attribute "android:debuggable='true'" in the resulting AndroidManifest.xml. Without proguard enabled, the resulting size seems the same. Assuming no compiler optimization, does this attribute cause or change the JIT optimization at run-time significantly?

  3. We use the debug key to sign the apk and it seems to work. Is the resulting apk truly a release version (We think so because "android:debuggable="true" is removed)?

Thanks.

1) Yes and no, even though the optimization is the same, the application will run slower as it will have lots of subproceses monitoring it.

2) AFAIK it isn't significative but it will affect the performance of your app.

3) It will work but it's not recommended, you should try reading the SDK here http://developer.android.com/tools/publishing/app-signing.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM