PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 19, 2022

[FIXED] How do I use an environment variable in the Xcode Scheme Arguments Passed On Launch window?

 August 19, 2022     environment-variables, xcode     No comments   

Issue

I'm trying to set up another Xcode project as the one passed on launch for the purposes of testing an Xcode extension:

enter image description here

Rather than hardcoding a path like this, I'd like to make it relative to the current directory.

I created a placeholder build script and output the environment variables. I found out that the current project directory can be accessed via the PROJECT_DIR environment variable.

How do I reference this environment variable in the Arguments Passed On Launch screen?

For example, instead of /Users/zoesmith/Desktop/Sample/TestableCode.xcodeproj, I'd like the path to be something like this instead:

PROJECT_DIR/../TestableCode.xcodeproj

Solution

Looks like the following works:

"$(PROJECT_DIR)/../TestableCode.xcodeproj"

I think the quotes are required in case PROJECT_DIR has any spaces in it.

I'm not sure what the difference is between $PROJECT_DIR and $(PROJECT_DIR), but both seem to work.



Answered By - Senseful
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing