Activate the Breakpoints in UI Automation Instrument for iOS - ios-ui-automation

Is there a way of activating the Breakpoints in Xcode Instruments Automation after writing several scripts because it would seem that there are there but just inactive. I was wondering if I could debug my JS code from the Automation instruments without having the Application code in Xcode?
Thanks

The reason you see the breakpoint options when you right click in the gutter of the UI Automation script editor is because the whole editor pane is the code editor reused from Xcode. It's unfortunately confusing, as you've found out, but apparently that was a convenient way for them to do syntax highlighting and all that inside Instruments.

Instruments works independently of Xcode, even if started from Xcode. If you run the Automation tool from Xcode, you will see that it starts you app and issues UI commands to it, without Xcode knowing about this: In XCode, the run button is still enabled.
This means that Xcode is not active, and breakpoints are not enabled. Thus, you cannot issue UI commands from Automation to you app so that it will stop at a breakpoint.

Related

Zerobrane debug on Corona SDK

I try to debug with Zerobrane , code for Corona SDK, but when I press the button to start the debug, popups all the time a window saying that main.lua is used from other programs. There is no other program using the main.lua
When i press the button then the corona simulator starts and this is using the main.lua . When I kill the corona simulator the popup windows disappear.
Any other experienced this?
Thanks in advance
There was a fix for the files not closed, which may be related to this issue. You can try with the current master branch version to see if it fixes the problem.

Xcode 9, iOS 11, XCUITest failure: Main Thread Checker Flurry Analytics

Running my suite of XCUITests using Xcode 9 running on iOS 11.
Tests all run perfect in Xcode 8 (iOS10), but in Xcode 9 I get the following error:
Main Thread Checker: UI API called on background thread [UIApplication statusBarOrientation]...
... Queue name: com.Flurry.Analytics.Session
This can be fixed by commenting out all the Flurry code, but that is obviously not ideal. This issue has been seen by devs previously:
https://github.com/flurry/flurry-ios-sdk/issues/91
However, in this case, the dev build compiles all correctly and this error only occurs when XCUITests are run.
Anyone know how to fix this?
To avoid crash in test you have to uncheck Main Thread Checker in your Scheme
Go Product > Scheme > Manage Schemes search the Scheme you use for your tests and press Edit... in the left sidebar press Test and then go to Diagnostics and uncheck Main Thread Checker checkbox
And try again
This is a temporal solution and you should try to avoid call UI API on background threads because the app could behave weirdly. But since you use third-party library you should wait until they fix it.

app runs within Xcode project, but not after built

I have a Xcode project, my small mac app runs all successfully within Xcode test run after compile, but by running the debug or release build by itself, the app become unresponsive after start running. No error or warning during building.
I don't know where to look to start troubleshooting this, so totally stuck. How do you start investigating for the issue like this?
I would start by setting an exception breakpoint for your project in Xcode. Xcode will pause your app when it throws an exception. Exceptions are thrown when runtime errors occur in your code. Setting an exception breakpoint can help you find the problem in your code.
If no exception breakpoints fire when you debug the app in Xcode, you will need to update your question with more information about your app. Is your app a GUI app or a command-line app? Does your app do anything special at startup, such as load files?

Automated user interface testing in Titanium

How can I create automated user interface tests for a Titanium app? Does the framework include something for this? Are there any helpful third party tools?
Have you looked at titanium-jasmine?
I have never personally used it but ive heard its pretty useful for this type of thing. I'm not sure about its abilities to test actually visual elements.
EDIT:
For testing the user interface and simulating touch events on the simulator or device, just use UIAutomation with the native workflow! Since every Titanium project compiles to an XCode project (which can and should be at least profiled for memory leaks using the native workflow before release to the app store), you can just follow the steps here to write your own tests in Javascript.
As a first step, run your app in the simulator, then got to PROJECT_HOME/build/ and open up the xcodeproj file. Once inside XCode, hold down the "Run" button, click "Profile", which will open up "Instruments" and add the "Automation" widget like in the link I provided!
This is not titanium specific, it can be used for any iOS app and seems like a great tool for every iOS developer, along with Allocators and Memory Leak widgets inside of instruments.
Possibly a better alternative is using Gorilla Logic's free MonkeyTalk. It is a bit more straightforward if your not very experienced with XCode, and it has the benefit of (theoretically) being able to test iOS and Android.

Cannot run project after updating Xcode project settings

Recently I updated my project settings as Xcode recommended. I just pressed a button and they did "everything". However now when I try to run my app on my device it freezes on the loading bar at about 75% and then after 15 seconds it says "build succeeded" but does not run on my device and everything stops as if I had pressed the stop button. I am getting no errors but I am getting the following warnings. It works on the simulator just fine.
For the record I have looked this up and everyone says to add "armv6 or armv7" and I already have this done. I am running deployment target iOS 3.0+
If anyone can help me, it would be appreciated. Thank you!
EDIT
Works on my device when I run leaks in instruments... but won't without instruments
Well, I can't really say much specific here, but if all else fails, I'd try making a new project and copying the content of this project to the new one. This could fix some underlying problems that may have developed in the build settings etc.