I have a large number of svg files I want to convert to xml vector assets for Android.
The documented process is, for each file, File->New->Vector Asset. Then choose the svg file, click Next then Finish.
Is there a faster way? Maybe a bash comment to launch Asset Studio?
There are few Git projects which would help you achieve the bulk conversion of svg files to Vector Drawable supported by android.
- Juraj Novák's : http://inloop.github.io/svg2android/
SvgToVectorDrawableConverter original repo was deleted. But you could choose one of the fork . Example: svg2vd -i "\*" -o out --fix-fill-type
- For single conversion: SVG to Vector Drawable Convertor online
- Use wrapper of original converter ported from Android Studio
Hope it helps!
download this jar file and use it as in the bellow example
java -jar C:\Users\dan\Downloads\Svg2VectorAndroid-1.0.jar C:\Users\dan\Desktop\svgs_dir
Keep Svg2VectorAndroid.jar
and the folder that having all the Svg file in same folder and then open cmd
and go to that folder path where you put your jar and source folder and then execute the command
java -jar Svg2VectorAndroid.jar <source folder name>
and press enter. Now you can get your all xml file in source folder with folder name ProcessedSVG
.
Hope it helps.
There is now an easier way to do this using Android Studio's Resource Manager tool.
See this answer for details.