Hi,
My application works with IoT devices, which is why I'm using a physical device for UI testing.
The aplication logs a lot of useful informations, especially errors, which are common when working with third-party IoT platforms.
Curreny I'm using logging library, which stores log data in the application's Documents directory, and I 'm able to download those data after testing using the 'ios-deply' tool in terminal.
It works quite well, but it's hard to read, and I would prefer to use Apple Logger instead, which is much cleaner.
When using Logger, every UI test sets Logger's category as its own testCase.name passing it via launchEnvironment or directly from code in Unit tests.
Then browsing every test's individual logs in .logarchive is simply by filtering by log category.
My main problem is with collecting logarchive after testing, using:
faslatne - collect logs only for simulators
log collect- requires sudo. I'm running tests from Jenkins on a Mac as a node.
cfgutil syslog, idevicesyslog - Only live logs
OSLogStore - would be great to collect logs from every failed testCase and save them as a separate file in the application document directory, which then can be downloaded via terminal, but tests have no access to logs from the application.
My questions are:
Is there safe way to call "sudo log collect" from a Jenkins' Mac node?
Access application/iPhone OSLogStore from test code?
Access application/iPhone OSLogStore from a Macbook using a terminal?
Maybe am I missing some other solutions?
Thank you :)
Post
Replies
Boosts
Views
Activity
Our UI Tests require interaction with physical devices. There is a Flask server on Raspberry Pi in our local network which is able to interact with those devices. From within XCTestCase we send request to this server and server does its job. Everything works on iOS13, but on iOS14 there is always an error that there is no internet connection -1009.
Application's and Test's info.plist has: App Transport Security Settings:
Allow Arbitrary Loads: True
Allows Local Networking: True Privacy - Local Network Usage Description
I suspect this is something with 'Local Network Premission' but setting its description in does not solve the problem.
Thanks
In new Xcode UIViewController and other UIView classes are marked as @MainActor by default:
@MainActor class UIViewController : UIResponder
But it seems no to be the same as marking UIViewController as @MainActror explicitly in code.
This code compiles:
class VC: UIViewController {
var array: [Int] = []
}
class Test {
let vc = VC()
func doSomething() {
vc.array.append(1)
}
}
but after adding "@MainActor" to VC:
@MainActor class VC: UIViewController {
var array: [Int] = []
}
class Test {
let vc = VC()
func doSomething() {
vc.array.append(1)
}
}
I got an error:
Property 'array' isolated to global actor 'MainActor' can not be mutated from this context