run_loop 2.1.0 → 2.1.1.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/run_loop/core_simulator.rb +42 -6
- data/lib/run_loop/sim_control.rb +1 -1
- data/lib/run_loop/simctl.rb +8 -0
- data/lib/run_loop/version.rb +1 -1
- data/lib/run_loop/xcode.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c918815b4ef775ad83f3f3ade7e33db64704d5b
|
4
|
+
data.tar.gz: a41970f9c49cb57129305389b4613af8ae2eb833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4602a64d7e56fadc22bb0eeb77f11421367b6513c51b0ab3dd6da8e5d38ed836e48223cfbd72176cc878e31c0e748ea5444a4eb5e5c38eee4ce9a58dc6491df5
|
7
|
+
data.tar.gz: 4b6faebb8be5987067ee0a3af74c35f3c0010256d3636c40fef9d638fd9a3027c693c6786b5f715b04dd85d1fd2f4b63ddccdd10391898bbf8d0218038e52af1
|
@@ -751,12 +751,48 @@ Command had no output
|
|
751
751
|
sim_app_dir = device_applications_dir
|
752
752
|
return nil if !File.exist?(sim_app_dir)
|
753
753
|
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
754
|
+
app_bundle_dir = Dir.glob("#{sim_app_dir}/**/*.app").find do |path|
|
755
|
+
RunLoop::App.new(path).bundle_identifier == app.bundle_identifier
|
756
|
+
end
|
757
|
+
|
758
|
+
app_bundle_dir = ensure_complete_app_installation(app_bundle_dir)
|
759
|
+
|
760
|
+
app_bundle_dir
|
761
|
+
end
|
762
|
+
|
763
|
+
# Cleans up bad installations of an app. For unknown reasons, an app bundle
|
764
|
+
# can exist, but be unrecognized by CoreSimulator. If we detect a case like
|
765
|
+
# this, we need to clean up the installation.
|
766
|
+
def ensure_complete_app_installation(app_bundle_dir)
|
767
|
+
return nil if app_bundle_dir.nil?
|
768
|
+
return app_bundle_dir if complete_app_install?(app_bundle_dir)
|
769
|
+
|
770
|
+
# Remove the directory that contains the app bundle
|
771
|
+
base_dir = File.dirname(app_bundle_dir)
|
772
|
+
FileUtils.rm_rf(base_dir)
|
773
|
+
|
774
|
+
# Clean up Containers/Data/Application
|
775
|
+
remove_stale_data_containers
|
776
|
+
|
777
|
+
nil
|
778
|
+
end
|
779
|
+
|
780
|
+
# Detect an incomplete app installation.
|
781
|
+
def complete_app_install?(app_bundle_dir)
|
782
|
+
base_dir = File.dirname(app_bundle_dir)
|
783
|
+
plist = File.join(base_dir, METADATA_PLIST)
|
784
|
+
File.exist?(plist)
|
785
|
+
end
|
786
|
+
|
787
|
+
# Remove stale data directories that might have appeared as a result of an
|
788
|
+
# incomplete app installation.
|
789
|
+
# See #ensure_complete_app_installation
|
790
|
+
def remove_stale_data_containers
|
791
|
+
containers_data_dir = File.join(device_data_dir, "Containers", "Data", "Application")
|
792
|
+
apps = Dir.glob("#{containers_data_dir}/**/#{METADATA_PLIST}")
|
793
|
+
apps.each do |metadata_plist|
|
794
|
+
if pbuddy.plist_read("MCMMetadataIdentifier", metadata_plist) == app.bundle_identifier
|
795
|
+
FileUtils.rm_rf(File.dirname(metadata_plist))
|
760
796
|
end
|
761
797
|
end
|
762
798
|
end
|
data/lib/run_loop/sim_control.rb
CHANGED
data/lib/run_loop/simctl.rb
CHANGED
@@ -53,6 +53,14 @@ module RunLoop
|
|
53
53
|
#
|
54
54
|
# This method is not supported on Xcode < 7 - returns nil.
|
55
55
|
#
|
56
|
+
# Simulator must be booted in El Cap, which makes this method useless for us
|
57
|
+
# because we have to do a bunch of pre-launch checks for sandbox resetting.
|
58
|
+
#
|
59
|
+
# Testing has shown that moving the device in and out of the booted state
|
60
|
+
# takes a long time (seconds) and is unpredictable.
|
61
|
+
#
|
62
|
+
# TODO ensure a booted state.
|
63
|
+
#
|
56
64
|
# @param [String] bundle_id The CFBundleIdentifier of the app.
|
57
65
|
# @return [String] The path to the .app bundle if it exists; nil otherwise.
|
58
66
|
def app_container(bundle_id)
|
data/lib/run_loop/version.rb
CHANGED
data/lib/run_loop/xcode.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run_loop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Krukow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -362,9 +362,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
362
362
|
version: '2.0'
|
363
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
364
364
|
requirements:
|
365
|
-
- - "
|
365
|
+
- - ">"
|
366
366
|
- !ruby/object:Gem::Version
|
367
|
-
version:
|
367
|
+
version: 1.3.1
|
368
368
|
requirements: []
|
369
369
|
rubyforge_project:
|
370
370
|
rubygems_version: 2.5.2
|