batchmode command not generating file

I am using batchmode command to export ios and android projects from my unity project.
Recently i tried to generate file, i am able to do that by exporting project via Unity Editor UI, but could not do it via automation script.

Here is the script i am using:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class CIEditorScript
static string SCENES = FindEnabledEditorScenes ();

static string TARGET_DIR = "somedir";

[MenuItem ("Custom/CI/Build iOS")]
static void PerformIOSBuild ()
	BuildOptions iosBuildOptions =  BuildOptions.CompressWithLz4 | BuildOptions.AcceptExternalModificationsToPlayer;
	GenericBuild (SCENES, TARGET_DIR + "/ios/", BuildTargetGroup.iOS, BuildTarget.iOS, iosBuildOptions);

[MenuItem ("Custom/CI/Build Android")]
static void PerformAndroidBuild ()
	BuildOptions androidBuildOptions =  BuildOptions.CompressWithLz4 | BuildOptions.AcceptExternalModificationsToPlayer;
	GenericBuild (SCENES, TARGET_DIR + "/android/", BuildTargetGroup.Android, BuildTarget.Android, androidBuildOptions);

private static string[] FindEnabledEditorScenes ()
	List<string> EditorScenes = new List<string> ();
	foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes) {
		if (!scene.enabled)
		EditorScenes.Add (scene.path);
	return EditorScenes.ToArray ();

static void GenericBuild (string[] scenes, string target_dir, BuildTargetGroup build_target_group, BuildTarget build_target, BuildOptions build_options)
	EditorUserBuildSettings.SwitchActiveBuildTarget (build_target_group, build_target);
    if (build_target == BuildTarget.Android){
		EditorUserBuildSettings.androidCreateSymbolsZip = true;
	BuildPipeline.BuildPlayer (scenes, target_dir, build_target, build_options);


Script runs fine, except it does not generate any file.

I am not sure if i am using the flag EditorUserBuildSettings.androidCreateSymbolsZip correctly.

I am using unity version: 2019.3.5f1

Have you ever found a solution to this? I’m having a similar issue. Tried attaching -androidCreateSymbolsZip to the batchmode command, but also no symbols file.

UI version creates one without issues.

i have same problem here