I am trying to pass an environment variable to my app when testing. I have already setup the environment variable as shown in the screenshot below:
When I run my Test (UITests) I try to access the variable in the actual app WeatherApp using the following code:
print(ProcessInfo.processInfo.environment["TARGET"])
But it always prints out nil. What am I missing?
Here is the code in my actual app:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print(ProcessInfo.processInfo.environment["TARGET"])
return true
}