import os import subprocess pjoin = os.path.join app_folder = sys.args[1] framework_folder = pjoin(app_folder, "Frameworks") plugin_folder = pjoin(app_folder, "Plugins") for framework in os.listdir(framework_folder): binary, subfix = framework.split('.') # should read Info.plist to find out the Binary path = ( pjoin(framework_folder, framework, binary) , pjoin(framework_folder, framework) ) [subfix != "framework"] r = subprocess.run([ 'codesign', '--remove-signature', path ], capture_output=True) print(path, r.returncode, r.stderr) if (os.path.exists(plugin_folder)): for plugin in os.listdir(): binary, _ = plugin.split('.') r = subprocess.run([ 'codesign', '--remove-signature', pjoin(app_folder, "Plugins", plugin, binary), ], capture_output=True) print(r.args, r.returncode, r.stderr)