0

Running calabash-ios on device and the app start and crash immediately.

Running calabash-ios on simulator works fine.

It is related to the issue: calabash-ios physical device test, app starts but crashes but the solution there is not working for me.

The app developed with Xamarin.

The app already been installed on the device.

I run the commands:

export BUNDLE_ID=com.appName.name
export DEVICE_ENDPOINT=http://192.168.1.14:37265
export DEVICE_TARGET=e2a5c640b9bc6fe30209612eefbf1194…
DEBUG=1 cucumber

And get the below:

INFO: Using uia strategy: 'host'
DEBUG: Searching for run-loop results with glob: /Users/nirortal/.run-loop/results/*
DEBUG: Found 6 previous run-loop results
DEBUG: Will delete 1 previous run-loop results
DEBUG: Deleted 1 previous results in 0.00405 seconds
DEBUG: Searching for instruments caches with glob: /Library/Caches/com.apple.dt.instruments/xrtmp__*
DEBUG: Found 6 instruments caches
DEBUG: Will delete 1 instruments caches
DEBUG: Deleted 1 instruments caches in 0.001272 seconds
2016-04-26 15:11:32 +0300 [RunLoop:debug]: 
{
                    :app => " com.appName.name ",
                   :args => [],
:bundle_dir_or_bundle_id => " com.appName.name ",
              :bundle_id => " com.appName.name ",
          :device_target => "e2a5c640b9bc6fe30209612eefbf1194…",
            :instruments => #<Instruments 7.3>,
          :launch_method => :instruments,
         :launch_retries => 5,
               :log_file => "/Users/nirortal/.run-loop/results/2016-04-26_15-11-32/run_loop.out",
              :no_launch => false,
                :no_stop => false,
     :relaunch_simulator => true,
                  :reset => false,
            :results_dir => "/Users/nirortal/.run-loop/results/2016-04-26_15-11-32",
      :results_dir_trace => "/Users/nirortal/.run-loop/results/2016-04-26_15-11-32/trace",
                 :script => "/Users/nirortal/.run-loop/results/2016-04-26_15-11-32/_run_loop.js",
            :sdk_version => nil,
                   :udid => "e2a5c640b9bc6fe30209612eefbf1194…",
           :uia_strategy => :host,
                  :xcode => "7.3",
             :xcode_path => "/Applications/Xcode.app/Contents/Developer"
} EXEC: xcrun instruments -s templates

### Starting on e2a5c640b9bc6fe30209612eefbf1194bee30933 App: com.gettradio.tradio ###
2016-04-26 15:11:32 +0300 [RunLoop:debug]: xcrun instruments -w e2a5c640b9bc6fe30209612eefbf1194… -D /Users/nirortal/.run-loop/results/2016-04-26_15-11-32/trace -t Automation com.appName.name  -e UIARESULTSPATH /Users/nirortal/.run-loop/results/2016-04-26_15-11-32 -e UIASCRIPT /Users/nirortal/.run-loop/results/2016-04-26_15-11-32/_run_loop.js >& /Users/nirortal/.run-loop/results/2016-04-26_15-11-32/run_loop.out
2016-04-26 15:11:32 +0300 [RunLoop:debug]: Preparation took 0.853639 seconds
2016-04-26 15:12:03 +0300 [RunLoop:debug]: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
2016-04-26 15:12:03 +0300 [RunLoop:debug]: Failed to launch. Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError

The device’s log:

Apr 26 15:13:28 iPhone-6-931 SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Apr 26 15:13:28 iPhone-6-931 SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Apr 26 15:13:28 iPhone-6-931 kernel[0] <Notice>: xpcproxy[293] Container: /private/var/mobile/Containers/Data/Application/81B447CB-DEE4-452A-8371-FA6652D6AC18 (sandbox)
Apr 26 15:13:28 iPhone-6-931 DTServiceHub[220] <Warning>: Unable to acquire task port after launch of pid 293 (com.appName.name)
Apr 26 15:13:28 iPhone-6-931 com.apple.xpc.launchd[1] (UIKitApplication:com.gettradio.tradio[0xd8eb][293]) <Notice>: Service exited due to signal: Killed: 9
Apr 26 15:13:29 iPhone-6-931 DTServiceHub[220] <Warning>: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
Apr 26 15:13:29 iPhone-6-931 notification_proxy[212] <Error>: 0x16e12f000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
Apr 26 15:13:29 iPhone-6-931 notification_proxy[212] <Error>: 0x16e1bb000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
Apr 26 15:13:29 iPhone-6-931 SpringBoard[58] <Warning>: Application 'UIKitApplication:com.gettradio.tradio[0xd8eb]' exited abnormally via signal.

I notice that in the log that the ‘Container: /private/var/mobile/Containers/Data/Application/81B447CB-DEE4-452A-8371-FA6652D6AC18 (sandbox)’ has a UDID of simulator.

Cannot find this UDID in my list when I run the command xcrun instruments -s devices

I have:

  • iPhone 6 – 9.3.1
  • xcode 7.3
  • calabash-cucumber (0.18.2, 0.17.0, 0.16.4, 0.14.0, 0.13.0, 0.12.3)
  • cucumber (1.3.19, 1.3.18, 1.3.17)
  • ruby 2.0.0p648
  • OS X - 10.11.4

the xcode recognize and connect to the device without any issue.

UI Automation on the device is enabled.

I ran the command ‘killall -9 instruments’ before running ‘cucumber’ but get the same result.

What I'm missing here?

Community
  • 1
  • 1
Nir Ortal
  • 77
  • 12

1 Answers1

0

‘Container: /private/var/mobile/Containers/Data/Application/81B447CB-DEE4-452A-8371-FA6652D6AC18 (sandbox)’ has a UDID of simulator.

That is the application data container on your physical device.

This is a very difficult problem to diagnosis and it usually comes down to one of these problems.

  1. The bundle id is incorrect.
  2. The app is not installed on the physical device.
  3. The .ipa installed on the device is not signed with Developer cert.
  4. The debugging symbols on the device have not been copied over to Xcode.
  5. The device is not eligible for instruments debugging.

The following information was pulled from these documents.

Bundle id is incorrect

# Find your .ipa bundle identifier
$ bundle exec calabash-ios console
> ipa = RunLoop::Ipa.new("path/to/my.ipa")
> ipa.bundle_identifier

App is not installed

# 1. Check with ideviceinstaller
# 2. Use a visual check in Xcode's Device window

.ipa is not signed with a developer cert

$ bundle exec calabash-ios console
> ipa = RunLoop::Ipa.new("path/to/my.ipa")
> ipa.codesign_info.split($-0)

You need to see a Developer certificate here:

"Authority=iPhone Developer: Joshua Moody (Y<snip>9)"

If you built and installed on your physical device from Xcode or Xamarin Studio, be sure that you are building with the Debug configuration and not a Release configuration. Check your project settings to be sure that you are signing the application with a Developer certificate.

Device is Not Ready

The device must appear in Xcode's Devices window without errors. Devices need to be restarted and reconnected to Xcode to clear these errors. After updating an iOS version, you might need restart/reconnect several times. If all else fails, plug the device into an other machine with Xcode installed; this can sometimes cause debugging symbols to be copied over.

The device may be enabled for development, but not be ready for instruments. You can check by targeting your device with a Automation template in the Instruments.app - this is described in the documents linked above.

jmoody
  • 2,480
  • 1
  • 16
  • 22