When will instruments process stop - instruments

Now I'm learning UI testing in Instruments. I want to know in what cases will the instruments process stop. Like when the App that is being tested crashes or something. Does someone konw?

I suggest you to use UI Testing based on XCTest instead of instruments and javascript. The javascript way of UI testing is officially deprecated.

Related

how to debug and issue tracking ios ui freezing?

I am developing a live platform using amazon IVS player SDK.
But I have a little problem.
The ui freezing phenomenon occurs intermittently, but it is difficult to debug because the clear call stack is not visible.
I have doubts, but I can't see it as open source.
mainThread callstack
Suspicious thread
The situation is as follows, but my expectation is that "psync_mutexwait" occurs on the "AVSampleBufferDisplayLayer" side on the open source side and freezes.. I am not sure if this is correct.
So, I'm going to do more debugging, but if there is any reason to think about it or any tips for debugging when the call stack is as follows in the state of ui freezing,
Please let me know that knowledge.
thank you.
Use XCode profiler. Go to Product > Profile and select Game Performance. It should help you to detect UI freezes at runtime. Detailed guide here.

Xcode/iOS App freezing, how to track such errors

I have sometimes app freezing I do not know what is the source of problem.
It happens rarely but happens. I consider how to track such issue
I have crashlytics from firebase but there is no errors as freezing is I suppose something with threads maybe some deadlocks or infinite loops.
Is there way to track such things?
What maybe reasons of app freezing and being inactive (it is SwiftUI app) ?
Are there possibilities to track/profile apps installed on devices (not connected via Xcode) and send informations such that are available in Instrument to something like firebase console or other 3rd party tools.
Update
I think I do not indicated important fact.
It freezes UI definitely not for a few seconds but app need do be killed and restarted again.
There might be some heavy process that locks your main thread, so it freezes your UI.
You track the problems, performance, leaks and more using Instruments.
There are sample topics:
Instruments Tutorial with Swift: Getting Started
How to find and fix slow code using Instruments
And WWDC videos like
Using Time Profiler in Instruments
Creating Custom Instruments
I have experienced some of these weird behaviours before. And mostly the reason behind it was a task that is blocking the main thread making it unresponsive. Pause the app and check the stack trace. Also make sure all your UI operations are done on the main thread. Hope this helps!

UI Automation Instruments: How to reset the app state?

I am new to UI Automation with Instruments, and I haven't found a way to reset the app state. How should I prevent tests from affecting each other? I also haven't found a way to use setUp or tearDown methods? It would be awesome if someone has a advice for me - thanks a lot!
I read in quit old blog post that it is not possible? On the other hand Appium is able to do it and it is actually using Instruments - so there must be a way?
Best regards,
Daniel
I think only way is by restarting application.
You can check this question How to continue testing an iOS app, using UIAutomation instrument, even after the app exits?

How to track down calls that are blocking the main (UI) thead?

I have an iOS app with some performance issues. In particular, when the user selects an item in a particular Core Data-backed UITableView there's a delay before the UI updates. Since there's very little multithreading in the app at the moment, I'm guessing I'm making a method call somewhere that's taking too long and blocking the UI thread.
Stepping through the code isn't revealing anything to me. (Perhaps because the problem is on another trip through the run loop? Not sure...I'm a solid iOS developer but a novice when it comes to the debugging and profiling tools.)
What's the best way to tackle a problem like this? Some way to step through or trace what the thread is doing in order and how long each call is taking, or something?
Thanks.
Check out the Time Profiler in Instruments. See WWDC 2012 - Building Concurrent User Interfaces on iOS for a practical demonstration of how you can use profiler to identify candidate methods that you might want to put in a background queue to avoid blocking the main queue.
See the Instruments User Guide for a basic description of the Instruments tool, but I think that WWDC video is a more effective way to gain familiarity with this particular instrument, the Time Profiler. Also, if you've never done concurrent Core Data, you might also want to see the Concurrency with Core Data section of the Core Data Programming Guide.
I will second what's Rob said: you will find more easily what's the bottleneck of your app using Time Profiler in Instruments. All references from Rob are good specially the one from WWDC. I also run into this tut in mobile tuts which covers the basics.

Is there a UI Exerciser for iOS like Monkey on Android?

I'm looking for a development tool that will allow me to send randomly generated user inputs (touches, hardkeys, gestures) to an iOS devices (not simulator) like Monkey on Android.
The UI Automation instrument in Instruments allows you to script interaction with your user interface, taking screenshots or testing for valid responses along the way. These testing scripts are written in JavaScript, which lets you run fairly complex tests.
The tests I've run have always been directed, but I don't see a reason why you couldn't use something like a random() function to trigger randomly placed touch events, etc. From this, you could build your own custom Monkey-like tool for hammering on your application. Even better, you could run other instruments at the same time as this one to identify potential memory leaks or CPU hotspots.
I show how UI Automation works as part of the Testing session in my course on iTunes U, for which my notes can be viewed here.

Resources