lib/run_loop/device.rb in run_loop-1.3.1 vs lib/run_loop/device.rb in run_loop-1.3.2
- old
+ new
@@ -6,10 +6,11 @@
attr_reader :udid
attr_reader :state
attr_reader :simulator_root_dir
attr_reader :simulator_accessibility_plist_path
attr_reader :simulator_preferences_plist_path
+ attr_reader :simulator_log_file_path
# Create a new device.
#
# @param [String] name The name of the device. For sims this should be
# 'iPhone 5s' and for physical devices it will be the name the user gave
@@ -30,10 +31,14 @@
else
@version = version
end
end
+ def to_s
+ "#{instruments_identifier} #{udid} #{instruction_set}"
+ end
+
# Returns and instruments-ready device identifier that is a suitable value
# for DEVICE_TARGET environment variable.
#
# @return [String] An instruments-ready device identifier.
# @raise [RuntimeError] If trying to obtain a instruments-ready identifier
@@ -109,10 +114,18 @@
return nil if physical_device?
File.join(simulator_root_dir, 'data/Library/Preferences/com.apple.Preferences.plist')
}.call
end
+ def simulator_log_file_path
+ @simulator_log_file_path ||= lambda {
+ return nil if physical_device?
+ File.join(CORE_SIMULATOR_LOGS_DIR, udid, 'system.log')
+ }.call
+ end
+
private
CORE_SIMULATOR_DEVICE_DIR = File.expand_path('~/Library/Developer/CoreSimulator/Devices')
+ CORE_SIMULATOR_LOGS_DIR = File.expand_path('~/Library/Logs/CoreSimulator')
end
end