In Xcode 9.2, for my iOS app, I have a Scheme for running my UI Test suite. In this scheme, under the \"Test\" tab, I have both environment variables and arguments defined.
Launch arguments and launch environments provided in the scheme editor are passed only to UI test runner. You can read those values only in UI test classes.
If you want to pass those values to the application itself you have to do it in the code:
let app = XCUIApplication()
app.launchArguments = ["amandaArgument"]
app.launchEnvironment = ["AMANDA_UI_TESTING": "Value"]
app.launch()