Posts

Post not yet marked as solved
0 Replies
1.6k Views
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 :)
Posted Last updated
.
Post marked as solved
2 Replies
1.3k Views
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
Posted Last updated
.
Post marked as solved
2 Replies
2.6k Views
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
Posted Last updated
.
Post not yet marked as solved
6 Replies
1.8k Views
Hi,a one year ago I was here for help with checking self signed certificate:https://forums.developer.apple.com/thread/102915In short:We are developing a smart home application which is communicating with our own devices (like smart socket plug) via HTTPS using IP address.Devices use our own CA, and iOS application set this certificate as a trusted by calling 'SecTrustSetAnchorCertificates' and override hostname by 'SecPolicyCreateSSL(true, name as CFString)'.And everything works fine till iOS13 where there are new requirements which we didn't meet:- TLS server certificates must present the DNS name of the server in the Subject Alternative Name extension of the certificate.DNS names in the CommonName of a certificate are no longer trusted.- TLS server certificates must contain an ExtendedKeyUsage (EKU) extension containing the id-kp-serverAuth OID.So now we added new extensions to our certificates, like so:X509v3 extensions: X509v3 Key Usage: Digital Signature, Key Encipherment, Data Encipherment, Key Agreement X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication X509v3 Subject Alternative Name: DNS:s-connect-12345678Now everything works again, but I'm not sure if this is correct approach.As I anderstand, we can treat SAN DNS name just like Common Name elier?Is it ok to set common name as SAN DNS? And then override hostname using 'SecPolicyCreateSSL(true, "s-connect-12345678")' (We communicate with device by IP address)BTW. Can we use 'SecTrustSetPolicies(trust, newTrustPolicies)' in iOS now instead?Thanks,Tomasz Trela
Posted Last updated
.