iPhone 6 not displaying in IBM Test Workbench Mobile Devices Tab - ios

Tool: IBM Mobilefirst TestWorkbench 8.6.0.1
OS: Windows 7
Device: iPhone 6 Version: 8.1.2
Laptop and iPhone are on same Network.
Click on Add Devices icon in Mobile Devices tab. Test Workbench URL pops up.
Entered the URL in my Safari browser in iPhone.
IBM Rational Test Workbench Mobile Client opens in my browser.
Problem
The Device does not show up in Mobile Devices Tab.
Able to record a Test in my iPhone6. After recording, getting a pop up in Test Workbench which says "Click here to generate Test Recordings". When i click that i get the below error in Error log
Plug-in: com.ibm.rational.test.lt.recorder.moeb
Message: CRRTWM1201E Unexpected exception while performing test generation.
Exception Stack Trace:
java.io.IOException: Unable to access device used for recording.
at com.ibm.rational.test.lt.recorder.moeb.ui.wizards.CreateTestFromRecordingLogsWizard.getSessionProducer(CreateTestFromRecordingLogsWizard.java:150)
at com.ibm.rational.test.lt.recorder.moeb.ui.wizards.CreateTestFromRecordingLogsWizard.createRecordingSession(CreateTestFromRecordingLogsWizard.java:128)
at com.ibm.rational.test.lt.recorder.moeb.ui.wizards.CreateTestFromRecordingLogsWizard.access$0(CreateTestFromRecordingLogsWizard.java:125)
at com.ibm.rational.test.lt.recorder.moeb.ui.wizards.CreateTestFromRecordingLogsWizard$1.run(CreateTestFromRecordingLogsWizard.java:91)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at com.ibm.rational.test.lt.recorder.moeb.ui.wizards.CreateTestFromRecordingLogsWizard.performFinish(CreateTestFromRecordingLogsWizard.java:86)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
Problem Guesses: Had instrumented the iOS app in Mac with jdk1.6
Presently uploaded the instrumented iOS app in Test Workbench in Windows Laptop which has jdk1.7. Could this be the problem ?

No the jdk should not be the issue.
The fact that your device doesn't appear in the mobile devices tab is not normal. This seems to be the origin of the issue.
The version 8.6.0.1 seems to be old... I recommand first that you update to the last one (8.7), re-instrumente the app and try again please ?
Thanks
Dominique

Related

How to log in Objective C when iPhone is not attached to Xcode

I am using Xcode Version 13.4.1 (13F100) on a MacBook Pro with macOS Monterey 12.4 and programming in Objective-C.
I would like to log debug messages when my app is running on the iPhone device AND is NOT attached to Xcode. I tried OSLog like described here: https://www.avanderlee.com/debugging/oslog-unified-logging/
However when I open the Console App and select my connected iPhone after running the app the log is empty and I have to explicitly click on "Start streaming" only then I can see my log when I start the app again.
I would like to log when the iPhone is not connected and the app is running and then close the app and connect the iPhone and see the log from the app run. I don't want live streaming but look into past logs.
Is there a way to do that?
I wrote to Apple Developer Support and they said the following:
If you log in your code using OSLog, then you can retrieve those
messages using the Terminal command ‘log’ later on.
For example, with the device named “iPhone" connected to the Mac, you
can retrieve the log info from the last 3 minutes with:
> % sudo log collect --device-name iPhone --last 3m
You can then use Console to look through the saved logs, or you can
parse out the log data from the command line with the ‘log' command.
See its man page for usage.
Here a link on how to use OSLog:
https://www.avanderlee.com/debugging/oslog-unified-logging/
In Objective-C this worked for me:
#import <os/log.h>
os_log(OS_LOG_DEFAULT, "Some message");
I followed Apple Developer Support's advice and it worked for me.

Swift: Preview on Device fails with "Error encountered when sending 'display' message to agent."

I am trying to get a device preview running on my iPad Pro (4th Gen.) running iOS 14.3. My MacBook Pro is running macOS Big Sure v11.2.1 and Xcode (Version 12.4 (12D4e)).
I am using a project provided by Apple (SwiftUI Tutorial). You can download the project profiles here: https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation
When I want to preview this project, the iPad runs Preview, the App opens as far as I can see but the screen remains white.
The Error I am receiving:
RemoteHumanReadableError: Failed to update preview.
Error encountered when sending 'display' message to agent.
==================================
| RemoteHumanReadableError
|
| LoadingError: failed to load library at path "/private/var/mobile/Containers/Data/Application/5C0603D6-DFAC-4045-AEB5-1F52FE81F045//tmp/E035A269-7512-4B63-A05C-26D2BF6E4226-ContentView.2.preview-thunk.dylib": Optional(dlopen(/private/var/mobile/Containers/Data/Application/5C0603D6-DFAC-4045-AEB5-1F52FE81F045/tmp/E035A269-7512-4B63-A05C-26D2BF6E4226-ContentView.2.preview-thunk.dylib, 2): no suitable image found. Did find:
| /private/var/mobile/Containers/Data/Application/5C0603D6-DFAC-4045-AEB5-1F52FE81F045/tmp/E035A269-7512-4B63-A05C-26D2BF6E4226-ContentView.2.preview-thunk.dylib: code signature invalid for '/private/var/mobile/Containers/Data/Application/5C0603D6-DFAC-4045-AEB5-1F52FE81F045/tmp/E035A269-7512-4B63-A05C-26D2BF6E4226-ContentView.2.preview-thunk.dylib'
| )
I can't imagine that this is caused by a bug from Apple, so I wonder how I could fix this. I would appreciate any help a lot.
I have a part answer to my problem. Instead of starting the real device preview from the preview panel on the right, I chose the play button on the top left. This way, you have to restart the preview every time you made changes and want to see them on the real device but at least building and previewing is fast.
Make sure that your connected device at the top bar is selected (on the screenshot it is not, you can see that because of the blue icon)
xcode real device preview screenshot

calabash-ios physical device test, app starts but crashes

Running calabash-ios cucumber for simple iPhone app. Simulator is working perfectly. When trying on physical device, app loads, crashes, then loads again, and crashes again, on a loop.
Error message:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
Logfile /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/run_loop.out
2015-05-22 19:58:11 +0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 2.594758s; Output : /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/trace.trace)
to run the script. UIAScriptAgentSignaledException
(Calabash::Cucumber::Launcher::StartError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:766:in `new_run_loop'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:631:in `relaunch'
Steps:
loaded app-cal on device
ran in command-line using:
$ DEVICE_TARGET=udid BUNDLE_ID=com.company.app DEVICE_ENDPOINT=http://ip:37265
Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
The probably cause of this is that the device is not enabled for UIAutomation. The device must be enabled for development. A device is enabled for development if it appears in Xcode's Device's window (Shift + Command +2) and you must enable on-device testing manually by visiting the device's Settings.app > Developer tab.
If you have recently upgraded the iOS version we recommend that you check the UIAutomation settings again and perform a restart. Often, after an upgrade, Xcode cannot download debugging information from the device. Look at Xcode's Device's window. The device must appear without any warnings.
Sometimes devices get into a bad state and Xcode cannot communicate with it. We recommend trying to interact with the device with Apple's Instruments to clear this bad state.
All this information and more can be found on the Calabash iOS Hot Topics page. https://github.com/calabash/calabash-ios/wiki/Hot-Topics#6-errnoeintr-interrupted-system-call

Calabash testing on iOS device starts app but freezes on "Scenario"

I have been trying to use Calabash to test some simple iOS apps. I was able to run the app on the simulator and all steps work fine. Now I want to test it on an iOS device, but I am having some problems. I run this command with all the necessary info:
BUNDLE_ID=... DEVICE_TARGET=... DEVICE_ENDPOINT=http://MY_IP:37265 cucumber
After a while the app opens in the iPhone and I get the usual information on console:
Feature: Running a test
As an iOS developer
I want to have a sample feature file
So I can begin testing quickly
Scenario: Example steps # features/my_first.feature:6
But it stays there forever. I left it for a while and it does nothing.
I have tried Appium, as well, for testing and it worked fine both on the simulator and on the iPhone, so I guess is not a problem with Profiles and the device itself.
What could be causing this issue?
My setup:
- Mac OS X 10.10.3
- Xcode Version 6.3 (6D570)
- iPhone 4 - iOS 7.1.2 (11D257)
- calabash-cucumber (0.14.0)
- cucumber (1.3.19)
UPDATE
Trying curl http://192.168.200.168:37265/version (as suggested by #alannichols) I get:
Failed to connect to 192.168.200.168 port 37265: Operation timed out
But I got my test to move to the first step executing the -cal target from Xcode (on the device) and running the command:
NO_LAUNCH=1 DEVICE_TARGET=... DEVICE_ENDPOINT=http://192.168.200.168:37265 cucumber
Still I am getting an error, but this time is a timeout error:
Operation timed out - connect(2) for "192.168.200.168" port 37265 (Errno::ETIMEDOUT)
Does it mean that I am reaching the iPhone by somehow I am not able to send requests?
If the app opens and nothing happens, it's usually to do with the device endpoint setting being incorrect. The app opens based on the bundle ID, but then calabash tries to interact with the app via the device endpoint.
Try running the app in the calabash console and if it behaves the same way as in your tests it'll be an issue with the device endpoint. Some ideas of things to check are that you're on the same network on the phone and the machine the test is running on, whether your vpn is interfering with the communication somehow or whether instruments is open on the test machine.
When the app is open you should be able to run
curl http://your.ip.address:37265/version
and get a response with the version number of calabash. If you can't get that then calabash won't be able to do anything in your tests.

How can I obtain crash logs for Mobile Safari in the iOS Simulator?

If Mobile Safari crashes in the iOS Simulator, where can the crash logs be found?
(Apple will want these attached to your bug reports.)
Look for files named MobileSafari_*.crash in ~/Library/Logs/DiagnosticReports/.
(Execute open ~/Library/Logs/DiagnosticReports/ in Terminal, then sort by date modified.)

Resources