Class: Xcodeproj::XCScheme::LaunchAction
- Inherits:
-
AbstractSchemeAction
- Object
- XMLElementWrapper
- AbstractSchemeAction
- Xcodeproj::XCScheme::LaunchAction
- Defined in:
- lib/xcodeproj/scheme/launch_action.rb
Overview
This class wraps the LaunchAction node of a .xcscheme XML file
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #allow_location_simulation=(flag) ⇒ Object
-
#allow_location_simulation? ⇒ Bool
Whether or not to allow GPS location simulation when launching this target.
-
#buildable_product_runnable ⇒ BuildableProductRunnable
The BuildReference to launch when executing the Launch Action.
- #buildable_product_runnable=(runnable) ⇒ Object
-
#command_line_arguments ⇒ CommandLineArguments
Returns the CommandLineArguments that will be passed at app launch.
-
#command_line_arguments=(arguments) ⇒ CommandLineArguments
Arguments Sets the CommandLineArguments that will be passed at app launch.
- #disable_main_thread_checker=(flag) ⇒ Object
-
#disable_main_thread_checker? ⇒ Bool
Whether this Build Action should disable detection of UI API misuse from background threads.
-
#environment_variables ⇒ EnvironmentVariables
Returns the EnvironmentVariables that will be defined at app launch.
- #environment_variables=(env_vars) ⇒ Object
-
#initialize(node = nil) ⇒ LaunchAction
constructor
A new instance of LaunchAction.
-
#launch_automatically_substyle ⇒ String
The launch automatically substyle.
- #launch_automatically_substyle=(value) ⇒ Object
- #stop_on_every_main_thread_checker_issue=(flag) ⇒ Object
-
#stop_on_every_main_thread_checker_issue? ⇒ Bool
Whether UI API misuse from background threads detection should pause execution.
Methods inherited from AbstractSchemeAction
#build_configuration, #build_configuration=
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(node = nil) ⇒ LaunchAction
Returns a new instance of LaunchAction.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 12 def initialize(node = nil) create_xml_element_with_fallback(node, 'LaunchAction') do # Add some attributes (that are not handled by this wrapper class yet but expected in the XML) @xml_element.attributes['selectedDebuggerIdentifier'] = 'Xcode.DebuggerFoundation.Debugger.LLDB' @xml_element.attributes['selectedLauncherIdentifier'] = 'Xcode.DebuggerFoundation.Launcher.LLDB' @xml_element.attributes['launchStyle'] = '0' @xml_element.attributes['useCustomWorkingDirectory'] = bool_to_string(false) @xml_element.attributes['ignoresPersistentStateOnLaunch'] = bool_to_string(false) @xml_element.attributes['debugDocumentVersioning'] = bool_to_string(true) @xml_element.attributes['debugServiceExtension'] = 'internal' @xml_element.add_element('AdditionalOptions') # Setup default values for other (handled) attributes self.build_configuration = 'Debug' self.allow_location_simulation = true end end |
Instance Method Details
#allow_location_simulation=(flag) ⇒ Object
46 47 48 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 46 def allow_location_simulation=(flag) @xml_element.attributes['allowLocationSimulation'] = bool_to_string(flag) end |
#allow_location_simulation? ⇒ Bool
Returns Whether or not to allow GPS location simulation when launching this target.
39 40 41 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 39 def allow_location_simulation? string_to_bool(@xml_element.attributes['allowLocationSimulation']) end |
#buildable_product_runnable ⇒ BuildableProductRunnable
Returns The BuildReference to launch when executing the Launch Action.
101 102 103 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 101 def buildable_product_runnable BuildableProductRunnable.new(@xml_element.elements['BuildableProductRunnable'], 0) end |
#buildable_product_runnable=(runnable) ⇒ Object
108 109 110 111 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 108 def buildable_product_runnable=(runnable) @xml_element.delete_element('BuildableProductRunnable') @xml_element.add_element(runnable.xml_element) if runnable end |
#command_line_arguments ⇒ CommandLineArguments
Returns the CommandLineArguments that will be passed at app launch
134 135 136 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 134 def command_line_arguments CommandLineArguments.new(@xml_element.elements[XCScheme::COMMAND_LINE_ARGS_NODE]) end |
#command_line_arguments=(arguments) ⇒ CommandLineArguments
Returns arguments Sets the CommandLineArguments that will be passed at app launch.
141 142 143 144 145 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 141 def command_line_arguments=(arguments) @xml_element.delete_element(XCScheme::COMMAND_LINE_ARGS_NODE) @xml_element.add_element(arguments.xml_element) if arguments arguments end |
#disable_main_thread_checker=(flag) ⇒ Object
62 63 64 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 62 def disable_main_thread_checker=(flag) @xml_element.attributes['disableMainThreadChecker'] = bool_to_string(flag) end |
#disable_main_thread_checker? ⇒ Bool
Returns Whether this Build Action should disable detection of UI API misuse from background threads.
54 55 56 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 54 def disable_main_thread_checker? string_to_bool(@xml_element.attributes['disableMainThreadChecker']) end |
#environment_variables ⇒ EnvironmentVariables
Returns the EnvironmentVariables that will be defined at app launch
116 117 118 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 116 def environment_variables EnvironmentVariables.new(@xml_element.elements[XCScheme::VARIABLES_NODE]) end |
#environment_variables=(env_vars) ⇒ Object
123 124 125 126 127 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 123 def environment_variables=(env_vars) @xml_element.delete_element(XCScheme::VARIABLES_NODE) @xml_element.add_element(env_vars.xml_element) if env_vars env_vars end |
#launch_automatically_substyle ⇒ String
Returns The launch automatically substyle.
87 88 89 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 87 def launch_automatically_substyle @xml_element.attributes['launchAutomaticallySubstyle'] end |
#launch_automatically_substyle=(value) ⇒ Object
94 95 96 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 94 def launch_automatically_substyle=(value) @xml_element.attributes['launchAutomaticallySubstyle'] = value.to_s end |
#stop_on_every_main_thread_checker_issue=(flag) ⇒ Object
80 81 82 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 80 def stop_on_every_main_thread_checker_issue=(flag) @xml_element.attributes['stopOnEveryMainThreadCheckerIssue'] = bool_to_string(flag) end |
#stop_on_every_main_thread_checker_issue? ⇒ Bool
Returns Whether UI API misuse from background threads detection should pause execution. This flag is ignored when the thread checker disabled ([disable_main_thread_checker] flag).
71 72 73 |
# File 'lib/xcodeproj/scheme/launch_action.rb', line 71 def stop_on_every_main_thread_checker_issue? string_to_bool(@xml_element.attributes['stopOnEveryMainThreadCheckerIssue']) end |