fastlane-old / snapshot

Automate taking localized screenshots of your iOS app on every device
https://fastlane.tools
1.95k stars 141 forks source link

launch arguments not working #462

Closed ilandbt closed 8 years ago

ilandbt commented 8 years ago

Hi, i added some lunch arguments in my snapfile

 launch_arguments([
  "-username user",
  "-password pass"
])

but i'm not getting them in my test. Im also not getting the "FASTLANE_SNAPSHOT" flag

    var app: XCUIApplication!

    override func setUp() {
        super.setUp()
        app = XCUIApplication()
        setupSnapshot(app)
        app.launch()
    }

    func testSnapshot(){
        if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT") {

            //get username and password from lunch arguments
            let u = NSUserDefaults.standardUserDefaults().stringForKey("username")!
            let p = NSUserDefaults.standardUserDefaults().stringForKey("password")!
        }
    }
vpolouchkine commented 8 years ago

You should access these in the app target, not the testing one.

fastlane-bot commented 8 years ago

This issue was migrated to https://github.com/fastlane/fastlane/issues/1637. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket: