Xcode UI Test environment variables not being passed from Scheme

前端 未结 1 1440
离开以前
离开以前 2021-01-17 19:33

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.

相关标签:
1条回答
  • 2021-01-17 20:02

    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()
    
    0 讨论(0)
提交回复
热议问题