1

I'm trying to get the .dex of a class to run some tests ( I want to test what is demonstrated in the answer here).

There is supposedly an answer to my question here, but that answer is either wrong or outdated: all of my projects' intermediates directories do not contain a directory called dex.

I am using Android Studio 1.0.1.

Community
  • 1
  • 1
Juicy
  • 11,840
  • 35
  • 123
  • 212

1 Answers1

0

Android Studio:

Build Type - Debug, Product Flavors - none, After running gradlew assembleDebug:

./app/build/intermediates/dex/debug/classes.dex

Android Device:

In APK:

See here: Where are .dex files located after apk installation?

After Install:

/data/dalvik-cache
Community
  • 1
  • 1
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
  • Thanks for the answer, however when I build my apps I only have a single directory in `intermediates` called `dex-cache`. This directory contains a single `cache.xml` file. I don't have any directories called `dex`. Do I need to change some setting before building? – Juicy Apr 02 '15 at 16:37
  • @Juicy Use your terminal/command prompt or file explorer/finder/etc, these are not shown in Android Studio. – Jared Burrows Apr 02 '15 at 16:38
  • You need to build your project. 1) `gradlew clean` 2) `gradlew assembleDebug`. – Jared Burrows Apr 02 '15 at 16:43
  • I just tried (Build -> Clean Project) and (Run -> Debug) :( – Juicy Apr 02 '15 at 16:47
  • I copied and pasted `./app/build/intermediates/dex/debug/classes.dex` after running `gradlew clean && gradlew assembleDebug`. Try what my answer says. – Jared Burrows Apr 02 '15 at 16:53
  • Sorry to sound ignorant but I don't seem to have `gradlew`, a quick Google search reveals that it's a windows batch no? When I do Build -> Clean the task bar says `Gradle executing task: clean` and Run -> Debug in Android Studio the task bar says `Gradle executing task: AssembleDebug` which seems to be what you're suggesting. – Juicy Apr 02 '15 at 16:58
  • Ah, I got the impression you were using your command prompt/terminal. Yes on Windows it is `gradlew.bat`. All I am saying is if you run the commands it will generable the APK file and the .dex file. – Jared Burrows Apr 02 '15 at 17:00