Class: FastlaneCore::DeviceManager::Device
- Inherits:
-
Object
- Object
- FastlaneCore::DeviceManager::Device
- Defined in:
- lib/fastlane_core/device_manager.rb
Overview
Use the UDID for the given device when setting the destination Why? Because we might get this error message > The requested device could not be found because multiple devices matched the request.
This happens when you have multiple simulators for a given device type / iOS combination
{ platform:iOS Simulator, id:1685B071-AFB2-4DC1-BE29-8370BA4A6EBD, OS:9.0, name:iPhone 5 }
{ platform:iOS Simulator, id:A141F23B-96B3-491A-8949-813B376C28A7, OS:9.0, name:iPhone 5 }
We don’t want to deal with that, so we just use the UDID
Instance Attribute Summary collapse
-
#ios_version ⇒ Object
Preserved for backwards compatibility.
-
#is_simulator ⇒ Object
Returns the value of attribute is_simulator.
-
#name ⇒ Object
Returns the value of attribute name.
-
#os_type ⇒ Object
Returns the value of attribute os_type.
-
#os_version ⇒ Object
Returns the value of attribute os_version.
-
#state ⇒ Object
Returns the value of attribute state.
-
#udid ⇒ Object
Returns the value of attribute udid.
Instance Method Summary collapse
-
#initialize(name: nil, udid: nil, os_type: nil, os_version: nil, state: nil, is_simulator: nil) ⇒ Device
constructor
A new instance of Device.
- #reset ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name: nil, udid: nil, os_type: nil, os_version: nil, state: nil, is_simulator: nil) ⇒ Device
Returns a new instance of Device.
154 155 156 157 158 159 160 161 162 |
# File 'lib/fastlane_core/device_manager.rb', line 154 def initialize(name: nil, udid: nil, os_type: nil, os_version: nil, state: nil, is_simulator: nil) self.name = name self.udid = udid self.os_type = os_type self.os_version = os_version self.ios_version = os_version self.state = state self.is_simulator = is_simulator end |
Instance Attribute Details
#ios_version ⇒ Object
Preserved for backwards compatibility
150 151 152 |
# File 'lib/fastlane_core/device_manager.rb', line 150 def ios_version @ios_version end |
#is_simulator ⇒ Object
Returns the value of attribute is_simulator.
152 153 154 |
# File 'lib/fastlane_core/device_manager.rb', line 152 def is_simulator @is_simulator end |
#name ⇒ Object
Returns the value of attribute name.
146 147 148 |
# File 'lib/fastlane_core/device_manager.rb', line 146 def name @name end |
#os_type ⇒ Object
Returns the value of attribute os_type.
148 149 150 |
# File 'lib/fastlane_core/device_manager.rb', line 148 def os_type @os_type end |
#os_version ⇒ Object
Returns the value of attribute os_version.
149 150 151 |
# File 'lib/fastlane_core/device_manager.rb', line 149 def os_version @os_version end |
#state ⇒ Object
Returns the value of attribute state.
151 152 153 |
# File 'lib/fastlane_core/device_manager.rb', line 151 def state @state end |
#udid ⇒ Object
Returns the value of attribute udid.
147 148 149 |
# File 'lib/fastlane_core/device_manager.rb', line 147 def udid @udid end |
Instance Method Details
#reset ⇒ Object
168 169 170 171 172 173 |
# File 'lib/fastlane_core/device_manager.rb', line 168 def reset UI.("Resetting #{self}") `xcrun simctl shutdown #{self.udid}` if self.state == "Booted" `xcrun simctl erase #{self.udid}` return end |
#to_s ⇒ Object
164 165 166 |
# File 'lib/fastlane_core/device_manager.rb', line 164 def to_s self.name end |