Running calabash-ios on physical device, and the app start and crash immediately - iphone

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?

‘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.
The bundle id is incorrect.
The app is not installed on the physical device.
The .ipa installed on the device is not signed with Developer cert.
The debugging symbols on the device have not been copied over to Xcode.
The device is not eligible for instruments debugging.
The following information was pulled from these documents.
Hot Topic: Errno::EINTR: Interrupted system call AKA RunLoop::Fifo::NoReaderConfiguredError
Testing on Physical Devices
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.

Related

xcode 5 - debug on device failed using jailcoder

Using xcode 5.1.1, and trying to debug my app on a jailbroken iphone 4 (7.1.2).
I installed Jailcoder (from the facebook page) and patched both my xcode and my project with it.
The project is just a simple view application (trying to get that to work first).
I run the app using my iphone as the build setting, the app loads on my phone but then it exits with
2014-07-28 16:00:42.831 testLiveDebug[11384:60b] otherApps (null)
Opening the console in the organizer i see this error:
Jul 28 15:51:45 my-iPhone com.apple.launchd[1] (UIKitApplication:com.debug.testLiveDebug[0xe02e][11348]) <Error>: (UIKitApplication:com.debug.testLiveDebug[0xe02e]) Exited with code: 45
Jul 28 15:51:45 my-iPhone com.apple.launchd[1] (UIKitApplication:com.debug.testLiveDebug[0xe02e]) <Notice>: (UIKitApplication:com.debug.testLiveDebug[0xe02e]) Throttling respawn: Will start in 2147483641 seconds
Jul 28 15:51:45 my-iPhone com.apple.debugserver-310.2[11346] <Warning>: 38 +6.392165 sec [2c52/1307]: error: ::read ( -1, 0x35a9ec, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Jul 28 15:51:45 my-iPhone com.apple.debugserver-310.2[11346] <Warning>: Exiting.
Jul 28 15:51:45 my-iPhone backboardd[11188] <Warning>: Application 'UIKitApplication:com.debug.testLiveDebug[0xe02e]' exited abnormally with exit status 45
I have Appsync for 7.0+ and also tried with AppSync Unified....but still i get the same error.
In the past (ios6) this whole process worked fine with jailcoder.
Any idea why i cant live debug on the device ?
-Thanks
Resupported 4+ was causing the error....after i uninstalled it everything was working fine.

How can I determine what crashed Mobile Safari?

My website crashes on Mobile Safari, but works fine on desktop.
How can I determine why it is crashing?
What you can do when Safari quits unexpectedly showing your website:
1. Safari debug console
Use Safari's debug console. Switch on in your iPhone: Settings->Safari->Advanced->Debug console=on.
For me it says
2 HTML errors on Line 6 (Viewport argument value "device-width" for key "width" not recognized and Viewport argument value "no" for key "user-scalable" not recognized.)
2 HTML tips also n Line 6.
Debug console will be shown next time you check your web page using Safari.
2. Web Inspector (from iOS 6.0)
If it is getting more complicated to find out the problem in your webpage use Web Inspector to Debug Mobile Safari. It is a great tutorial for this.
Using IOS Simulator I found that for this particular website all iOS version I have, 5.0, 5.1 and also 6.1, runs the page correctly with crashing the page but on device (iOS 5.0.1) still crashes.
My device runs on iOS 5, so I cannot access Web Inspector, but it is certainly the next step for you to check your site on device and check Web Inspector on your machine.
3. Use iPhone Configuration Utility's Console
You can downlod Apple's iPhone Configuration Utility, then you can access your mobile's Console during Safari test.
Checking your site I see couple of memory warnings which eventually lead to Safari crash.
4a. Use Xcode's debug facility
Using Xcode you can also access the device's Console (Window->Organizer->Devices tab->Console).
Your case reported the following on console:
Apr 30 10:15:18 unknown kernel[0] <Debug>: launchd[2489] Builtin profile: MobileSafari (sandbox)
Apr 30 10:15:38 unknown MobileSafari[2489] <Warning>: Received memory warning.
Apr 30 10:15:39 unknown SpringBoard[15] <Warning>: Received memory warning.
Apr 30 10:15:50 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
Apr 30 10:15:50 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilephone[0xb2a4]) Exited: Killed: 9
Apr 30 10:15:50 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilesafari[0xf755]) Exited: Killed: 9
Apr 30 10:15:50 unknown SpringBoard[15] <Warning>: Application 'Phone' exited abnormally with signal 9: Killed: 9
Apr 30 10:15:50 unknown SpringBoard[15] <Warning>: Application 'Safari' exited abnormally with signal 9: Killed: 9
Apr 30 10:15:52 unknown ReportCrash[2491] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2013-04-30-101552.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
4b. Use Xcode's debug facility, Instruments
Another sophisticated way to check what's happening is to use Instruments.
Checking again your site I see many-many low memory warning reported by Safari before it quits. Sadly it doesn't directy help you discovering the web site problem but maybe helps to find Safari open bug reports.
I had success debugging a crash by doing the following:
connect to the phones console using xcode
find the crash in the console, in my case is looks like this:
Sep 2 17:16:21 Edwards-iPhone ReportCrash[7093] : Saved report to /Library/Logs/CrashReporter/JetsamEvent-2015-09-02-171621.ips
Then go to Diagnostics in settings (settings > privacy > diagnostics & usage data - that's on ios 8.4. It's in a different place on other versions) and find the crash file.
This removes the need to guess at which crash reports the one you experienced.

Worklight: Service connection failed Dialog Box

I am facing an unexpected issue that is when I am running App
most of the times a dialog box open up and saying "Application failed
connection to the service " See snapshot:
Though after two or three times pressing "Reload" button on this dialog connects App with WL Server and then App works fine. But if I kill App and then re-run it , again same dialog appears.
It also appears when you first time run App after installing on a device.
My App was running perfectly fine from two months back.
The only new thing that I have done is Push Notification. This is the
only new feature that I have added in the App.
Any suggestion on this?
What could be the root cause of this issue? How can I trace it?
And if I want to disable this dialog and instead show a
custom message (alert) on screen. Because this dialog box reveals the
running service / WL server URL.
In the console it only shows "Application failed connection to the service "
And while clicking on the Details option on the dialog box. It shows correct address of WL Server. And after three/four times of reload it connects App with server and then works fine, and afterwards goes fine and doesn't show anything.
The Logs are given below:
Apr 15 14:24:51 iPhone myApp[2746] <Warning>: [LOG] ondeviceready event dispatched
Apr 15 14:24:51 iPhone myApp [2746] <Warning>: {
appVersionPref = "1.0";
freeSpace = 13572620288;
wlSkinLoaderChecksum = "(null)";
wlSkinName = default;
}
Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] Application did not define an i18n messages object, skipping translation.
Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] wlclient init started
Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] Read cookies: null
Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] CookieMgr read cookies: {}
Apr 15 14:24:57 iPhone myApp [2746] <Warning>: [LOG] Connection went Down: Mon Apr 15 2013 14:24:57 GMT+0300 (AST)
Apr 15 14:24:57 iPhone myApp [2746] <Warning>: [ERROR] Client init failed. Connection to the service is not available.
Apr 15 14:25:07 iPhone myApp [2746] <Warning>: [LOG] ondeviceready event dispatched
Apr 15 14:25:07 iPhone myApp [2746] <Warning>: {
appVersionPref = "1.0";
freeSpace = 13572620288;
wlSkinLoaderChecksum = "(null)";
wlSkinName = default;
}
by clicking Details:
Apr 15 2013 23:55:17 GMT+0300 (AST)
Apr 15 23:55:17 iPhone myApp[3116] <Warning>: [ERROR] Client init failed. Connection to the service is not available.
Apr 15 23:55:19 iPhone myApp[3116] <Warning>: WLReachability Flag Status: -R -----l- networkStatusForFlags
Apr 15 23:55:59 iPhone kernel[0] <Debug>: launchd[3120] Builtin profile: MobileSafari (sandbox)
Apr 15 23:56:02 iPhone kernel[0] <Debug>: launchd[3121] Builtin profile: syncdefaultsd (sandbox)
Apr 15 23:56:21 iPhone myApp[3116] <Warning>: Copied text: 'App Diagnostics
Time : Mon Apr 15 2013 23:55:19 GMT+0300 (AST)
Application Name : myApp
Application Version : 1.0
Service URL : https://www.mydomain.com.bh:443/AppProject/apps/services/api/myApp/iphone/
Device Platform : iPhone
Device Version : 6.1
Screen Resolution : 320x480
Airplane Mode : Not available
Using Network : WIFI
Wifi Name : Not available
Mobile Network Type : Not available
Carrier Name : Not available
IP Address : 192.168.109.101
Error Code : UNRESPONSIVE_HOST
Error Message : Connection to the service is not available.
HTTP Status :
It sounds like there's a network issue preventing you from connecting to your Worklight server.
This can be due to many different reasons, to list some:
Poor WiFi/3G
Faulty device
Firewall issues on the network where the webserver is hosted
Worklight server issue
To ensure that you are indeed reaching the server I would suggest using a network sniffer. One tool that runs on Windows is Fiddler.
Fiddler can be set up as a reverse proxy where your device will be making calls to the proxy. The proxy will then route your request to the web server but it will also log the information so you can view it.
If you are on Windows, I would suggest installing Fiddler and following Option #2 of this answer.
You should then be able to see if your requests are reaching the server and continue investigation from there.

Unable to connect jailbroken iPhone 3G running iOS 4.2.1 to Xcode for development

I have jailbroken iPhone 3G and recently I've updated the firmware to 4.2.1 (was 3.1.2). Now I'm trying to add this iPhone to Xcode organizer to use it for development. Xcode runs the process of collecting debug information for the device but gets stuck copying file (2 of 2) somewhere about 80%. I switch to Console and see nothing that could relate to the problem. Where can I get more information about what's happeining?
Update:
I've tried to reconnect the device and this time there is multiple lines in Console:
Sun Nov 20 02:13:57 unknown lockdownd[17] <Error>: 2ffea000 handle_connection: Could not receive USB message #6 from DTDKSymbolHelper. Killing connection
Sun Nov 20 02:13:57 unknown com.apple.mobile.lockdown[17] <Notice>: Could not receive size of message
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: Found paths:
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: /usr/lib/dyld
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv6
Sun Nov 20 02:14:59 unknown lockdownd[17] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from MDCrashReportTool. Killing connection
Googling did not give any results.
Make sure you have an SDK installed on your desktop that supports the iOS version installed on your iPhone. Otherwise, Xcode will not recognize your device. You can also launch Organizer and it will tell you whats going on and if your device (OS) is supported.
Is it possible that you disabled any launchdaemons?
If you disabled an accessory launch daemon then I'm guessing it could affect xcode connecting to the device.
Have you tried to Un-Jailbreak it.

"security policy error" on iPhone and iPod Touch

I'm getting an "Error from Debugger: Error launching remote program: security policy error" when I try to run my app on my ipod touch. The provisions look in order, and the app builds to my iphone 3gs just fine. The app used to build just fine to my ipod touch, so I'm flustered what could have changed and wondering if anyone has any thoughts on what might be causing this issue. The build logs are below.
Mon Mar 15 14:25:54 unknown com.apple.debugserver-43[449] <Warning>: Connecting to com.apple.debugserver service...
Mon Mar 15 14:25:55 unknown SpringBoard[24] <Warning>: Unable to launch com.yourcompany.Unearthed because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Error>: error: unable to launch the application with CFBundleIdentifier 'com.yourcompany.Unearthed' sbs_error = 9
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Warning>: 1 [01c1/0903]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: ''
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Warning>: error: failed to launch process (null): security policy error
Mon Mar 15 14:26:03 unknown MobileSafari[72] <Warning>: void SendDelegateMessage(NSInvocation*): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: UITrackingRunLoopMode
Have you checked that the iPod doesn't contain any expired provisioning profiles? I've had trouble in the past when building to devices that contain expired provisioning profiles.
Try removing any expired profiles and see if it helps.
Delete all old expire provisioning profile..
We "fixed" this by installing the release version (built for ad-hoc distribution) and then debugging from Xcode. It installs and updates the application fine from now. 3GS with 4.3.2.