How to uninstall and install a app for every test in XCUITest (Xcode 11.7) - xcode-ui-testing

In my present app, after user registers, we won't show the register screen again
Is there any way to uninstall and install the app or at-least to clear the app cache to get the register screen for every test.
I am using XCODE 11.7 and i am running the test in parallel.

Related

How can I test a standalone watchOS application?

I can't figure out how to test running my watchOS app as a standalone app. When I run it on the simulator it never works unless I also have the associated iOS app. Running the watch scheme shows that the iOS app is running along with the watchOS app. I created a scheme which just builds the watch and it will cause the watch app to start, but it doesn't actually update the compiled binary.
First of all, you have to create certificates for all project targets and upload on Testflight, Through Testflight (mobile application) you can install the app and it will sync automatically in the watch.
The second option will, Connect your watch with mobile and install that watch application via Xcode on mobile, it will sync automatically in the watch.

WatchOS5 - how to debug an apple watch app?

I'm brand new to watchOS development - have my first app and extension. I have the following questions:
Are breakpoints available for watch OS extensions and apps? I set them, but they don't seem to trigger
Does the app fail to appear on the watch if there's a fatal crash during launch? It seems when I make a mistake, the app simply fails to install and I get almost no info in console and no stack trace of any kind.
How do I debug a WatchOS5 app is there some option I need to enable on device or XCode?
You can select watch complication or extension from the list of schemes in the run menu and run the app on watch and device. I was running the test app only.
The bad news is that the process times out on my old Macbook air when trying to run on device. And the watch Simulator is terribly slow, working at about 2 FPS.

Debugging Apple Watch and iOS app simultaneously

Up until today, I've been able to build, run, and debug my watch app and iOS app at the same time. When I build and run, the debugger attaches to the watch automatically. Then I have to manually attach the iOS debugger. I have been following these steps and they always worked perfectly. I can hit breakpoints on both on the watch and the phone (which is what I need to do to be able to debug things like sendMessage or applicationContext).
The problem now is that when I go to attach the iOS app to the debugger manually (via Debug -> Attach to Process), it doesn't show up in the likely targets or in applications at all, even though the app is running on the phone.
I checked my schemes and made sure that the targets were still correct- they are.
I even tried Debug -> Attach to Process with PID or Name. When I try to attach the iOS app by name, I get an error saying Will install Watch App called with bad bundle identifier '(null).
Why is my iOS app no longer a likely target? How can I get it to attach to the debugger again while my watch app is also attached?
I use another way to debug on watch app and iPhone app at the same time. I run this script when watch and iPhone simulators are running on my Mac. Then launch my watch app or iPhone app on the same simulators. I can observe both log at the same time.
P.S. These log are come from console, so you should use NSLog(), not print().

How application behaves when updated from Mac App Store?

I'm building sandboxed OSX app (with embeded helper app that is running on the background) that will be delivered through the Mac App Store and I'm not sure how update will affect app life cycle.
What will happen with running app, when user hits update in app
store?
What will happen with running background helper app when user hits
update in app store?
Are apps installed under different accounts updated separately?
Thanks for any help, documentation for sandboxed apps doesn't have any information about update process.

Can you get a crash log from iTunes Connect when you build on an app you downloaded?

Can you get an iTunes Connect crash log when you download your app from the App Store and then build on that app using Xcode?
Let's say I have a released version, and I download it from the app store to test, then later on I want to make some changes to my code.
I don't delete the downloaded app, but I just build over it from Xcode. Then I add a lot of breakpoints during the initial launch to check. Suddenly, my app crashes because it isn't able to launch in time.
Will the crash be sent to iTunes Connect?
Also, it is possible for your app to fail launching when you have a lot of break points added and you try to step into things?
I'm using Xcode 4.6.
Once you run your app from Xcode, your app is no longer the same app. It is now your development app. If it crashes, nothing is sent to iTunes.
When you run your app through Xcode, the timeout is disabled. You could let it sit for a week and the OS will not kill it for taking too long to startup.
And I believe you mean "iTunes Connect" where ever you mention "iTunes".

Resources