function executionManager = createHostExecutionManager(command, arguments)
%CREATEHOSTEXECUTIONMANAGER Utility to create a Target Framework execution
% manager for host process execution.

% Copyright 2022 The MathWorks, Inc.

arguments
% don't specify command as char/string otherwise implicit conversion
% of numeric inputs occurs
command {mustBeTextScalar}
arguments cell {mustBeText} = {}
end

% Specify options
options = targetframework.services.appexecution.ExecutionOptions();
options.ApplicationArguments = arguments;
% Create the execution tool
exeTool = target.internal.create('HostProcessExecutionTool');
exeTool.StartCommand.String = '$(EXE)';
% create the execution service
executionManager = targetframework.services.appexecution.createExecutionManager(command, ...
exeTool, options);