I have an info.plist file with variables inside, such as ${PRODUCT_NAME} or ${EXECUTABLE_NAME}.
Where does there variables reference to?
And how do I know these variables will be converted into what string by Xcode?
Here is the answer,
$(PRODUCT_BUNDLE_IDENTIFIER) and $(PRODUCT_NAME) comes from,
And ${EXECUTABLE_NAME} is concatenation of:
$EXECUTABLE_PREFIX, $PRODUCT_NAME and $EXECUTABLE_SUFFIX.
All are in Build Settings.
Related
I tried using the Environment Variable APSNETCORE_ENVIRONMENT in my csproj file as a condition. But it doesn't seem to work.
The code:
<Target Name="NpmInstall" Inputs="$(SpaRoot)/package.json" Outputs="$(SpaRoot)/node_modules/.install-stamp" Condition="$(ASPNETCORE_ENVIRONMENT) != 'Development'">
NVM, appereantly msbuild only takes the system variables but not the ones defined in the debug tab.
Solved it by adding my desired variable to the Global Environment Variables.
Try to wrap the variable in single quotes in the condition, like
Condition="'$(ASPNETCORE_ENVIRONMENT)' != 'Development'">
I need to upload an app that has a * in its name, but when I try to upload it to ItunesConnect I get this error
This bundle is invalid. The executable name, as reported by
CFBundleExecutable in the Info.plist file, may not contain any of
these characters: []{}parenthesis.+*"
I need to keep the * but how can I edit my info.plist to be accepted?
The app name is set by CFBundleDisplayName and the executable name is set by CFBundleExecutable in your Info.plist-file. They do not have to be equal.
The CFBundleDisplayName and CFBundleExecutable has the default value of ${PRODUCT_NAME}, but you can enter any string you want.
So:
Change your product name to change the ${EXECUTABLE_NAME}, removing *. See Xcode 4: How to change ${EXECUTABLE_NAME} variable's value?
Edit CFBundleDisplayName in the Info.plist file to the desired value. Here you can add *.
Sorry about my poor English, I hope you can understand what I'm describing
I know how to pass arguments, like -v, -c, etc
Edit Scheme > Run xxx > Arguments
In Termimal.app, when I type the following, it shows the correct result, as expected.
./C_Product < main.c
How should I do this in Xcode?
I tried to add argument < main.c, but it did not affect.
I already copied main.c file to
C_Productxxxxx -> Build -> Products -> Debug
with C_Product at the same place
I don't know of a way to get Xcode to pipe the contents of a file to std in automatically. However, you do have some other options. You could modify your program to take the filename as an argument, and then pass in the filename as an argument as you have above. So you could make -i <foo> be the name of the input file. (Or better yet, -input-file <foo>.)
Alternatively, you could modify your application to read from a file whose path is in an environment variable. So your app could call getenv("MY_INPUT_FILE"); and you could tell Xcode to set the value of "MY_INPUT_FILE" environment variable to the path of the input file in the scheme.
I need to share information from a plist with someone who is not technically inclined. Is there a common free editor that one can use to view plist info in a similar way in which it is presented in Xcode? Or is there a way to print it out?
In other words I would like to view the plist without all the xml-like mark up and without the use of Xcode.
Command-line options for viewing Plist files:
For viewing only: Use plutil -p, which prints the content of a property-list in JSON-like format (the format is meant for human consumption only).
Example (append | open -tf to view output in a text editor):
plutil -p ~/Library/Preferences/com.apple.sidebarlists.plist
Alternative: Use /usr/libexec/PlistBuddy -c print, which outputs in JavaScript-object-literal-like format:
Example:
/usr/libexec/PlistBuddy -c print ~/Library/Preferences/com.apple.airplay.plist
Caveat:
If the plist has properties containing binary data, PlistBuddy will include it in raw form (by contrast, non-binary properties in the same file are printed properly). If XML output is desired, add option -x.
Note that PlistBuddy:
can be used to extract properties selectively using :-separated, case-sensitive property paths; e.g., /usr/libexec/PlistBuddy -c 'print :favorites:ShowRemovable' ~/Library/Preferences/com.apple.sidebarlists.plist
is also capable of modifying Plist files from the command line (including, with limitations, importing from previously exported-to XML files).
See /usr/libexec/PlistBuddy -h for details.
The standalone "Property List Editor" is gone since Xcode 4, you can use Pref Setter which is free but last updated 4 years ago.
To save the contents without the xml tags see this example:
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[#"~/Library/Preferences/loginwindow.plist" stringByExpandingTildeInPath]];
[[dict description] writeToURL:[NSURL fileURLWithPath:[#"~/Desktop/loginwindow.txt" stringByExpandingTildeInPath]] atomically:YES encoding:NSUTF8StringEncoding error:nil];
You can use visual studio code to open and edit Plist files.
Just need to install an extension in the visual studio code called Binary Plist:
Binary Plist
Publisher: David Nicolson
Marketplace Link: https://marketplace.visualstudio.com/items?itemName=dnicolson.binary-plist
There is a way to get the old Property List Editor working on Mac OS X Lion, if you don't want to use bloated XCode 4 for this.
There is a "Property List Editor" app as part of OS X (or there used to be, I'm away from my machine at the moment so can't check).
Failing that, you could write one in about half an hour!
I am invoking VSDBCMD.EXE in my build process template, there is a custom setvar parameter that requires a reference to the current source directory, passing this path has become an unexpected challenge.
I've tried using relative paths and $(SourceDirectory) to no avail (it remains as the literal string "$(SourceDirectory)" when I see the debug output), the parameter needs an absolute path.
Is there any way to get the absolute path for the current source directory when the script runs?
In the DefaultTemplate build workflow there is a variable called SourcesDirectory that contains the absolute path.
If you pass it to an InvokeProcess you just type the variable name in the activity property, no $() around it.
It might be worth checking out this resource, where author makes use of ConvertWorkspaceItem within his build in order to pass in a string the disk location of a know target in source control