For mac, the dx command tool is stored in different directory as said in the top answer. Here is how you do it in mac:
exampleName$ /Users/exampleName/Library/Android/sdk/build-tools/25.0.2/dx --dex --output="/Users/exampleName/Downloads/classes-dex2jar.jar" "/Users/exampleName/Downloads/name.dex"
More detailed explanation:
- The dx tool is stored in the android SDK, but in a different directory on macs, the path for a mac is
/Users/exampleName/Library/Android/sdk/build-tools/25.0.2/
- The command is the same for windows and mac, the path is just different
- The command for both platforms is
dx --dex--output="c:\temp\app.apk" "c:\temp\in.jar"
- The tool may take a few minutes to produce the dex file
If it's still not working for some reason, make sure you are following these requirements:
I know this is late, but I had to figure this out on my own after hours of trial and error—hope it helps some other mac user