The following is a batch processing to hit the jar package.
First, copy the following code and then create a new txt text on the desktop, rename the file to a. bat suffix, edit it, paste the code into the Save, and double-click to run the batch file.
@echo Offecho "Please enter the module path (right-click on module and select Copy Path to get the path):" Set/p Modulepath=echo%modulepath%set classespath=% Modulepath%\build\intermediates\classes\debugset jarpath=%modulepath%\libsmd%jarPath%echo "Classes path is:" Echo% Classespath%echo "Start packing, please wait ... "JAR-CVF%jarpath%my.jar%classespath%comecho" package complete, the jar package in the Libs directory of the module:-) "Pause
Code Analysis:
@echo Offecho "Please enter the module path (right-click on module and select Copy Path to get the path):" set/p modulepath= 1. Enter the module path, and assigned to Modulepath2. Use the module path to get the class path and assign the value to Classespath\debugset jarpath=%modulepath%\libs\ 3. Path of packaged jar MD%jarpath% 4. Create jar Path echo "Classes's path is:" Echo%classespath%echo "start packing, please wait ... "JAR-CVF%jarpath%my.jar%classespath%com 5. Execute the Package command (make sure the class folder name under the Classespath path is com echo "package complete, jar package in the Libs directory of the module:-)" Pause
Classes Path:
Hit the jar package:
How Android Studio packs a Jar pack