How to dynamically share data between MyAppUITests and the MyApp target?

Within MyAppUITests I can pass some parameters to MyApp in following way:

app.launchEnvironment = ["my_param": "value"]
app.launch()

This is visible for MyApp and I can read this:

  • How to dismiss FBWebDialogs
  • Adding Navigation Bar on Tab-Bar Based App
  • WatchKit reloadRootControllersWithNames causing error, with pageController or after push/pop
  • How to skip the login scene and start straight from the next if you are already authorized?
  • Swift Unit test- How do I assert that a CGColor is what it's supposed to be?
  • When hiding the statusbar my navigation bar moves up in iOS7
  • if let value = NSProcessInfo.processInfo().environment["my_param"] {
       //do sth with value
    }
    

    But this is how I can set it up BEFORE I launch the app. For some reason, I need to change "my_param" on runtime AFTER I launch the app. Any suggestions? I would appreciate any help.

    Why do I need to do it for?

    I need "my_param" to be able to change within MyAppUITests after I launch the app. "my_param" needs to be visible for MyApp in whatever place within MyApp. my_param might be mock response for my network client or whatever I need for that time.

    NOTE:

    Similar functionality is between App and its extension. There is solution with App Group and shared NSUserDefaults. What is here? Do I have to save it on device to share sth to another target?

    UPDATE:

    App Group doesn’t work here.