XCUIApplication launchArguments not set on application process.
| Originator: | dan.trenz | ||
| Number: | rdar://23295830 | Date Originated: | 10/28/2015 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | iOS 9.* |
| Classification: | Reproducible: | Yes |
Summary:
When setting launch arguments on XCUIApplication from a XCTestCase setUp class method, they are not found in the arguments array of NSProcessInfo inside the app bundle.
Note: This works as expected when setting arguments from a XCTestCase setUp instance method.
Steps to Reproduce:
1. From test bundle/suite — Add a launch argument to an XCUIApplication via XCTestCase setUp class method before launch:
override class func setUp() {
let app = XCUIApplication()
app.launchArguments.append("SETUP_MOCK_ENDPOINTS")
app.launch()
}
2. From AppDelegate — Attempt to read the launch argument from NSProcessInfo:
[[[NSProcessInfo processInfo] arguments] containsObject:@"SETUP_MOCK_ENDPOINTS"]
Expected Results:
Launch argument should be set & readable in NSProcessInfo.
Actual Results:
Launch argument does not appear in arguments array of NSProcessInfo.
Version:
iOS 9.*
Notes:
Configuration:
Any iOS device/simulator should be able to reproduce this. I'm using an iPhone 6s simulator.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!