Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP experimental feature for auto detection device/simulator selected in xcode #447

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ark-konopacki
Copy link
Contributor

@ark-konopacki ark-konopacki commented Apr 21, 2016

WIP do not merge!
experimental feature for auto detection device/simulator selected in xcode described in calabash/calabash-ios#651
can be checked in calabash-ios console (should wait some time about 5 sec after changing device and running server)

@ark-konopacki ark-konopacki changed the title WIP do not merge WIP experimental feature for auto detection device/simulator selected in xcode Apr 21, 2016
@@ -39,7 +41,19 @@ def find_xcodeproj
end

# @!visibility private
def ignore_xcodeproj?(path)
def self.find_user_state_files
username = Etc.getpwuid.name
Copy link
Contributor

@jmoody jmoody May 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new method to RunLoop::Environment: self.username.

@jmoody
Copy link
Contributor

jmoody commented May 11, 2016

This needs rspec tests.

username = Etc.getpwuid.name
user_state_file_paths = []
Dir.glob("#{Dir.pwd}/**/xcuserdata/#{username}.xcuserdatad/UserInterfaceState.xcuserstate").each do |path|
next if ignore_xcodeproj?(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore_xcodeproj is an instance method. You cannot call it from a class method.

@jmoody
Copy link
Contributor

jmoody commented May 16, 2016

@ark-konopacki You should rebase this. If you need help; we can pair.

Once you have rebased, we can discuss why the test are failing.

@ark-konopacki
Copy link
Contributor Author

@jmoody sorry for mess in PR, now tests are passing and selected device (only sim) is detected, so basically ready for review.

@jmoody
Copy link
Contributor

jmoody commented May 27, 2016

@ark-konopacki We need to rebase this. Let's since next week; I will be back in Germany by Monday. Thanks!

@@ -1,3 +1,5 @@
require 'etc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to inside the module definition.

module RunLoop
  module DetectAUT
     require "etc"
  end
end

Prefer " vs. '.

@jmoody
Copy link
Contributor

jmoody commented Jun 3, 2016

@ark-konopacki

This is looking much better!

You gotta rebase it though. :)

@ark-konopacki
Copy link
Contributor Author

@jmoody Ok it is better now, but i cannot use RunLoop::Shell.exec it just hangs on this file.
So basically it works only as it is, i don't have an idea how to improve it.

@calabash-ci
Copy link

Can one of the admins verify this patch?

@ark-konopacki ark-konopacki force-pushed the feature/auto-detect-selected-device branch from bf8bd08 to 958e43a Compare October 7, 2016 07:16
@ark-konopacki
Copy link
Contributor Author

@jmoody can you please check why jenkins failing ?

@jmoody
Copy link
Contributor

jmoody commented Oct 19, 2017

This should be rebased against develop.

I think we might be able to simplify this by reading the ~/Library/Preferences/com.apple.iphonesimulator.plist for CurrentDeviceUDID key.

RunLoop::PlistBuddy.new().plist_read("CurrentDeviceUDID", <file>)

Maybe this could be implemented in CoreSimulator? See #647

I would ask in the community to see if there is support for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants