calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

iOS 10.2.1 - Unable to install device agent on physical device #1285

Open wujiayi101 opened 7 years ago

wujiayi101 commented 7 years ago

Hi, I am testing on iOS 10.2.1, right after I use xcodebuild to install app onto the device, and I run cucumber to start the test, below code is trying to executed.

@calabash_launcher = Calabash::Cucumber::Launcher.launcher
@calabash_launcher.relaunch
@calabash_launcher.calabash_notify(self)

but it hangs for very long time and eventually end up with below error:

Could not install /Users/xxx/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/run_loop-2.3.1/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app.  iOSDeviceManager says:

    install
        -d,--device-id  <device-identifier> iOS Simulator GUIDs
        -a,--app-bundle <path/to/app-bundle.app>    Path .app bundle (for .ipas, unzip and look inside of 'Payload')
        -c,--codesign-identity  <codesign-identity> [OPTIONAL]  Identity used to codesign app bundle [device only]  DEFAULT=
        -u,--update-app <true-or-false> [OPTIONAL]  When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1

my software versions:

- xcode 8.2
- Using cucumber-core 1.5.0
- Using run_loop 2.3.1
- Using cucumber 2.4.0
- Using calabash-cucumber 0.20.4

Is there anything wrong with my setup or code use?

wujiayi101 commented 7 years ago

And i am seeing this in the mac console log, not sure whether it helps to root cause the reason

could not enable test hierarchy: ApplePinningAllowTestCertsAppleSWUpdateSigning not true
wujiayi101 commented 7 years ago

the problem seem to be solved by exporting Code Sign Identity env variable.

is this a must step for testing 10.2 physical device?

jmoody commented 7 years ago

@calabash_launcher.calabash_notify(self)

Remove this call. It is no longer necessary.

run-loop 2.4.0 is out.

It has improved code signing.

the problem seem to be solved by exporting Code Sign Identity env variable. Is this a must step for testing 10.2 physical device?

https://github.com/calabash/calabash-ios/wiki/DeviceAgent#run-loop-223

Normally it is not necessary, but I can imagine cases where it would be helpful to resolve ambiguous matches.

sivaramprasadc commented 7 years ago

Mac OS: Sierra Device with 10.3.2 Xcode: 8.2.1 run_loop: 2.4.1 calabash-cucumber: 0.20.4

start_test_server_in_background Error log:RunLoop::Shell::TimeoutError: Timed out after 120.05 seconds executing /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/bin/iOSDeviceManager install --device-id 7f5237a6826497d662a8a5118570c48a1b521247 -a /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app with a timeout of 120 from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/shell.rb:104:in run_shell_command' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/ios_device_manager.rb:139:inlaunch' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/client.rb:1354:in launch_cbx_runner' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/client.rb:271:inlaunch' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop/device_agent/client.rb:147:in run' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/run_loop-2.4.1/lib/run_loop.rb:113:inrun' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/calabash-cucumber-0.20.4/lib/calabash-cucumber/launcher.rb:408:in block in new_run_loop' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/calabash-cucumber-0.20.4/lib/calabash-cucumber/launcher.rb:406:intimes' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/calabash-cucumber-0.20.4/lib/calabash-cucumber/launcher.rb:406:in new_run_loop' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/calabash-cucumber-0.20.4/lib/calabash-cucumber/launcher.rb:365:inrelaunch' from /Users/automationtesting/.rvm/gems/ruby-2.4.1/gems/calabash-cucumber-0.20.4/lib/calabash-cucumber/core.rb:1567:in `start_test_server_in_background'