Class: Xcodeproj::XCScheme::RemoteRunnable

Inherits:
XMLElementWrapper show all
Defined in:
lib/xcodeproj/scheme/remote_runnable.rb

Overview

This class wraps the RemoteRunnable node of a .xcscheme XML file

A RemoteRunnable is a product that is both buildable (it contains a BuildableReference) and runnable remotely (it can be launched and debugged on a remote device, i.e. an Apple Watch)

Instance Attribute Summary

Attributes inherited from XMLElementWrapper

#xml_element

Instance Method Summary collapse

Methods inherited from XMLElementWrapper

#to_s

Constructor Details

#initialize(target_or_node = nil, runnable_debugging_mode = nil, bundle_identifier = nil, remote_path = nil) ⇒ RemoteRunnable

Returns a new instance of RemoteRunnable.

Parameters:

  • target_or_node (Xcodeproj::Project::Object::AbstractTarget, REXML::Element) (defaults to: nil)

    Either the Xcode target to reference, or an existing XML ‘RemoteRunnable’ node element to reference or nil to create an new, empty RemoteRunnable

  • runnable_debugging_mode (#to_s) (defaults to: nil)

    The debugging mode (usually ‘2’)

  • bundle_identifier (#to_s) (defaults to: nil)

    The bundle identifier (usually ‘com.apple.Carousel’)

  • remote_path (#to_s) (defaults to: nil)

    The remote path (not required, unknown usage)



24
25
26
27
28
29
30
31
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 24

def initialize(target_or_node = nil, runnable_debugging_mode = nil, bundle_identifier = nil, remote_path = nil)
  create_xml_element_with_fallback(target_or_node, 'RemoteRunnable') do
    self.buildable_reference = BuildableReference.new(target_or_node) if target_or_node
    @xml_element.attributes['runnableDebuggingMode'] = runnable_debugging_mode.to_s if runnable_debugging_mode
    @xml_element.attributes['BundleIdentifier'] = bundle_identifier.to_s if bundle_identifier
    @xml_element.attributes['RemotePath'] = remote_path.to_s if remote_path
  end
end

Instance Method Details

#buildable_referenceBuildableReference

Returns The buildable reference this remote runnable is gonna build and run.

Returns:

  • (BuildableReference)

    The buildable reference this remote runnable is gonna build and run



78
79
80
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 78

def buildable_reference
  @buildable_reference ||= BuildableReference.new @xml_element.elements['BuildableReference']
end

#buildable_reference=(ref) ⇒ Object

Parameters:

  • ref (BuildableReference)

    Set the buildable reference this remote runnable is gonna build and run



85
86
87
88
89
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 85

def buildable_reference=(ref)
  @xml_element.delete_element('BuildableReference')
  @xml_element.add_element(ref.xml_element)
  @buildable_reference = ref
end

#bundle_identifierString

Returns The runnable bundle identifier (usually ‘com.apple.Carousel’).

Returns:

  • (String)

    The runnable bundle identifier (usually ‘com.apple.Carousel’)



50
51
52
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 50

def bundle_identifier
  @xml_element.attributes['BundleIdentifier']
end

#bundle_identifier=(value) ⇒ Object

Parameters:

  • value (String)

    Set the runnable bundle identifier



57
58
59
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 57

def bundle_identifier=(value)
  @xml_element.attributes['BundleIdentifier'] = value.to_s
end

#remote_pathString

Returns The runnable remote path (not required, unknown usage).

Returns:

  • (String)

    The runnable remote path (not required, unknown usage)



64
65
66
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 64

def remote_path
  @xml_element.attributes['RemotePath']
end

#remote_path=(value) ⇒ Object

Parameters:

  • value (String)

    Set the runnable remote path



71
72
73
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 71

def remote_path=(value)
  @xml_element.attributes['RemotePath'] = value.to_s
end

#runnable_debugging_modeString

Returns The runnable debugging mode (usually ‘2’).

Returns:

  • (String)

    The runnable debugging mode (usually ‘2’)



36
37
38
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 36

def runnable_debugging_mode
  @xml_element.attributes['runnableDebuggingMode']
end

#runnable_debugging_mode=(value) ⇒ Object

Parameters:

  • value (String)

    Set the runnable debugging mode



43
44
45
# File 'lib/xcodeproj/scheme/remote_runnable.rb', line 43

def runnable_debugging_mode=(value)
  @xml_element.attributes['runnableDebuggingMode'] = value.to_s
end