【问题标题】:Running calabash-ios on physical device, and the app start and crash immediately在物理设备上运行calabash-ios,应用立即启动并崩溃
【发布时间】:2016-08-20 08:44:25
【问题描述】:

在设备上运行 calabash-ios,应用立即启动并崩溃。

在模拟器上运行 calabash-ios 效果很好。

这与问题有关:calabash-ios physical device test, app starts but crashes 但那里的解决方案对我不起作用。

使用 Xamarin 开发的应用。

该应用已安装在设备上。

我运行命令:

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

并得到以下内容:

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

设备的日志:

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.

我注意到在日志中‘Container: /private/var/mobile/Containers/Data/Application/81B447CB-DEE4-452A-8371-FA6652D6AC18 (sandbox)’ 的 UDID 为模拟器。

当我运行命令 xcrun instruments -s devices 时在我的列表中找不到这个 UDID

我有:

  • iPhone 6 – 9.3.1
  • xcode 7.3
  • 葫芦-黄瓜(0.18.2、0.17.0、0.16.4、0.14.0、0.13.0、0.12.3)
  • 黄瓜(1.3.19、1.3.18、1.3.17)
  • 红宝石 2.0.0p648
  • OS X - 10.11.4

xcode 识别并连接到设备没有任何问题。

设备上的 UI 自动化已启用。

我在运行“黄瓜”之前运行了命令“killall -9instruments”,但得到了相同的结果。

我在这里缺少什么?

【问题讨论】:

    标签: iphone ruby calabash-ios


    【解决方案1】:

    ‘Container: /private/var/mobile/Containers/Data/Application/81B447CB-DEE4-452A-8371-FA6652D6AC18 (sandbox)’的 UDID 为模拟器。

    这是您的物理设备上的应用程序数据容器

    这是一个非常难以诊断的问题,通常归结为这些问题之一。

    1. 捆绑包 ID 不正确。
    2. 该应用未安装在物理设备上。
    3. 设备上安装的 .ipa 未使用开发者证书进行签名。
    4. 设备上的调试符号尚未复制到 Xcode。
    5. 该设备不符合仪器调试条件。

    从这些文档中提取了以下信息。

    捆绑包 ID 不正确

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

    应用未安装

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

    .ipa 未使用开发者证书签名

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

    您需要在此处查看开发人员证书:

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

    如果您是通过 Xcode 或 Xamarin Studio 在物理设备上构建和安装的,请确保您使用的是调试配置而不是发布配置进行构建。检查您的项目设置以确保您使用开发者证书对应用程序进行签名。

    设备未就绪

    设备必须出现在 Xcode 的设备窗口中没有错误。需要重新启动设备并重新连接到 Xcode 才能清除这些错误。更新 iOS 版本后,您可能需要多次重启/重新连接。如果一切都失败了,将设备插入另一台安装了 Xcode 的机器;这有时会导致调试符号被复制。

    该设备可能已启用开发,但尚未准备好用于仪器。您可以通过使用 Instruments.app 中的自动化模板定位您的设备进行检查 - 这在上面链接的文档中进行了描述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-04
      • 2012-07-27
      • 1970-01-01
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      • 2013-12-19
      • 1970-01-01
      相关资源
      最近更新 更多