Why does running UIAutomation methods from KIF result in: "UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings"? - ios-ui-automation

Using:
iOS 8.4, XCode 6.4, KIF 3.2.1 (https://github.com/kif-framework/KIF)
I encounter the following problem on a real device:
While running a KIF test case, calling the method, "deactivateAppForDuration" results in the following output seen in the XCode console: "UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings."
On the simulator, the app does indeed go to the background for the duration specified in the parameter of that method call.
I can confirm that the setting in device settings, "Developer >
UIAutomation" is toggled on.
The build that I am compiling and running is a Debug build and is
signed with my Developer Provisioning Profile (not a distribution
profile).
All the possible compile configurations in the scheme are
set to debug (profile for example)
I can record and playback UI interactions in the instruments
developer tool (confirms that the app is built right and that the
phone settings are correct)
Specific Code:
[tester deactivateAppForDuration:5];
What could I be missing?

This is a known issue with UIAutomation on the device, see here.

Related

Newbie cannot properly run or debug fresh project using Gluon multi-view with FXML in IntelliJ

I created a brand new Gluon mobile multi view with FXML project in IntelliJ CE 2018.2.1 using the Gluon plugin version 2.7.0 and Gradle 4.10.1
I open the Gradle tool window, Pick Project(root), Tasks, Application, run and I do see the generated application run properly, I believe, though it defaults to a mobile device sized window.
I get this error message:
SEVERE: javafx.platform is not defined. Desktop will be assumed by default.
What I'd like to do is debug a single JavaFX program in IntelliJ for all of the supported platforms (except embedded) in Windows and see more or less the right screen sizes before I start plugging in my iPad/iPhone/Android phone/Android tablet/Mac just to get the code logic right.
Is there some setting that would let me switch between simulating different devices as a first stage?
When I double click "debug" I get the following message and the window hangs.
Listening for transport dt_socket at address: 5005
Is this related? Are we trying to debug an actual device by accident?
As for the app size, when you run on desktop it defaults to a phone form factor of 335x600. This comes from the Display service:
#Override
public Dimension2D getDefaultDimensions() {
return isTablet() ? new Dimension2D(900, 600) : new Dimension2D(335, 600);
}
You can change to a tablet format of 900 x 600 if you set the charm-desktop-form system property to tablet.
Or you can simply override these settings, and set your desired size:
#Override
public void postInit(Scene scene) {
Swatch.BLUE.assignTo(scene);
if (Platform.isDesktop()) {
((Stage) scene.getWindow()).setWidth(400);
((Stage) scene.getWindow()).setHeight(800);
}
}
When you deploy your app to a mobile device, it will just adjust to the size of its screen.
Related to the message javafx.platform is not defined running on desktop, that system property is not defined, so it is a warning message that informs that desktop is selected. When you run on mobile, the proper Android or iOS value will be set for the platform.
Finally, about debugging, when you run on desktop you initially can debug only the desktop application, but you can modify the size of the application as mentioned above.
To debug the mobile application, you have to run either the iOS simulator or the Android emulator.
This question shows how to debug on Android from IntelliJ, but you have to actually deploy the application to a mobile device.
On iOS, providing you have a Mac, you can use the launchIPhoneSimulator task to launch the iOS simulator, where you can choose any of the possible iPhone or iPad devices with their different screens resolutions. In this case you don't need a device.
Solution to part 2: Debug the Desktop version from inside IntelliJ.
In IntelliJ, make a new Run configuration of type Gradle and use "run" not "debug" as the "task". Then choose "backpack [run]" from the toolbar and use the "debug" icon on the toolbar. IntelliJ will run the app with the JDWP options enabled and connect the debugger to it.

App crashing on launch with instrumentation w/ calabash-ios

UPDATE: This was fixed by resetting the phone's settings. General -> Reset -> "Reset all settings".
We are having on issue on iPhones 6 and 6+ when launching our IBM MobileFirst-based app.
When calabash instrumentation is linked and I manually launch the app, the splash screen will come up and the app will quit almost instantly.
Double tapping home shows me the app running in the background, but Xcode does not recognize it as a running process. After force-closing the app and re-launching, it will usually do the same thing, but sometimes it comes up.
I've noticed our automation is sometimes stuck in an infinite loop of launching and crashing. This only happens on the instrumented app.
The crash log throws EXC_BAD_ACCESS. I found a thread on the google group from a few years back that talks about linker flags, but I don't have any of the weaker flags mentioned there.
Steps to reproduce:
*App must be instrumented with the calabash automation framework (calabash-ios setup must have been executed in same directory as xcodeproj file.)
Build application and deploy native iOS project to XCode via eclipse.
Build the -cal target with the "Run" configuration.
Kill the debugger/application.
Manually launch the app on the device. The app will successfully launch maybe 15%-20% of the time, otherwise it will just quit.
Using calabash-cucumber version 0.14.3.
Linker flags:
$(inherited)
-force_load
"$(SRCROOT)/calabash.framework/calabash"
-lstdc++
It appears $(inherited) contains -ObjC for Debug.
Xcode installed at: /Applications/Xcode.app/Contents/Developer
Xcode version: 6.1.1
Xcode build: 6A2008a
The user is unresponsive, the fix was:
Actually I just found the fix to this. What I had to do is reset the
phone's settings in Settings -> General -> Reset -> "Reset All
Settings" (the first option). Have not seen the behavior since.
I had exact same problem, tried so many different ways and finally found how to fix it - I changed project directory, pulled from Git, then bundle install, pod install and build the app with calabash target as usual
Xcode 7.3.1, calabash-cucumber (0.19.1)

'WLAuthorizationManagerPlugin' not found, or is not a CDVPlugin

I have a hybrid app I am building for iOS. It uses Adapter authentication which has been working fine.
I recently updated from MobileFirst Studio 6.3 to 7.0. At the same time, I updated Xcode to version 6.3. My app continues to work fine and authenticates with the backend fine when run through the Browser Simulator, but running on a simulator or real device from Xcode, I get a connection timeout error. The console contains this: ERROR: Plugin 'WLAuthorizationManagerPlugin' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
I see lots of questions on SO for "plugin not found or is not a CDVPlugin", but since this is a MobileFirst plugin, I wouldn't expect it to suddenly go missing. Could this be fallout from the update?
Is this a sample project from the MFP Developer Center, or an application of your own.
Either way, you can create a new project and add the iPhone environment and compare your project's native\config.xml with the new project's native\config.xml and correct yours accordingly.

xcode timed out waiting for app to launch

Application get fail to launch in device having iOS 6.0 from xcode 4.5. Xcode says Application can't be launched timed out waiting for app to launch. I reset my all device settings. Cross checked if i choosed right provisioning. Yes, its right. here i am attaching image of console. Please help me out.
None of the above tips helped me. It turned out I was using my Distribution Profile instead of the Developer Profile in Debug mode. You can check the Profile you are using by going to
Build Settings->Code Signing Entity.
Make sure you are using your Developer Profile in Beta and Debug mode.
I had a similar issue when trying to debug an App with Ad-Hoc provisioning... Check which provisioning you're using, it seems ad-hoc provisioning cannot be used for debbuging.
Whenever this happens to me, I have done the following to fix the problem:
Stop the app from running in Xcode.
Delete the app from the device (or Simulator).
Select Product > Clean from the Xcode menu.
Close Xcode.
Close the Simulator (or restart the device).
Restart your computer (yes I know this like a Windows solution but seriously).
Try again.

Debugging iOS app built from commandline

I am building an app for iOS via commandline but I am having problems debugging it. Had I built using XCode, it would have let me "build and debug" on device without problems. But now, I don't know how to launch it on device using gdb and step through it. If I try to "add a custom target/executable" to a blank XCode project and then launch it, XCode complains about not finding the executable. Same thing happens if I install the app on device manually and try to attach to it using gdb within XCode. Any pointers on how to go about debugging this app? Changing the build process to use XCode is not an option.
This site gives a nice tutorial on how to manually set up a remote debugging session on an iOS device. The process boils down to creating a remote debugging server on the device and attaching to it with a local GDB instance.