Where can I find information on how to modify these
${EXECUTABLE_NAME}
${PRODUCT_NAME}
These are only displayed in .plist file but where are the actual values.
If we can directly modify what ever we want in .plist why we need these.
I am new that's why I'm having problem understanding these, I also looked into apple information Property list key reference but didn't find these ${} values.
The PRODUCT_NAME is defined in the target's Build Settings in the Packaging section. It has the same name by default as your project.
Edit:
While PRODUCT_NAME is by default the name of the Target (MyDemoApp in this case). The EXECUTABLE_NAME is a concatenation of:
$EXECUTABLE_PREFIX, $PRODUCT_NAME and $EXECUTABLE_SUFFIX.
See the reference of EXECUTABLE_NAME for details.
Update
The new reference can be found here http://help.apple.com/xcode/mac/8.3/#/itcaec37c2a6
EXECUTABLE_NAME
Specifies the name of the binary the target produces.
I think the $ represents the variable productName & executableName as the $ is used in unix. The variables are set in the build setting of the application. So you should not change the product name directly in the plist file. Instead, go to build settings, search for product name and change it.
Xcode ${<variable_name>} syntax
Xcode variable can be defined on different level and the Resolved one is used. You can use Build Settings -> Levels tab to manage it
All variables are listen in Build Settings. Also every setting has it's own declaration
Product Name - PRODUCT_NAME
These setting are saved in buildSettings block of
<project_name>.xcodeproj/project.pbxproj
You can use Search view to find any variable and Help Inspector to find declaration and other useful information
Some of settings are not exposed by Xcode
EXECUTABLE_NAME
But you are able to get or even to override the value using User-Defined Settings
reader_EXECUTABLE_NAME = $(EXECUTABLE_NAME)
EXECUTABLE_NAME = $EXECUTABLE_PREFIX$PRODUCT_NAME$EXECUTABLE_SUFFIX
[SWIFT_MODULE_NAME, PRODUCT_MODULE_NAME, PRODUCT_NAME, EXECUTABLE_NAME]
[TARGET_NAME]
Specifically about how ${PRODUCT_NAME} gets defined in terms of order:
It's originally defaulted to the target's name: $(TARGET_NAME)
You can reset it in 'build settings' by searching for Product Name
Note: If any value was derived off of ${PRODUCTS_NAME} and you change it to some-constant-value then it's no longer going to be a computed value.
e.g. if you change the value of CFBundleName from its default ${PRODUCT_NAME} to something like My cool App then your app's name on the springboard will show up as 'My cool App'. It will no longer show up as 'whatever your target's name is'
Related
I want to disable the printing of Logging Dynamic loader events (dyld) in the XCode console. I found a solution here.
But I couldn't find Log Dyld API Usage and Log Library Loads options in product scheme diagnostics of XCode 11. Please help me find them.
PS: If there is a new process in Xcode11 for disabling logs, please let me know.
Answer: This step by step solution is suggested below in the answers. I am just attaching this picture for a better understanding.
Dynamic loader
Events environment variables
One would say that you can set environment variables like DYLD_PRINT_APIS=0, DYLD_PRINT_APIS=false, DYLD_PRINT_APIS=no, ... but it doesn't work in this way. Check the source code:
else if ( strcmp(key, "DYLD_PRINT_APIS") == 0 ) {
gLogAPIs = true;
}
In other words gLogAPIs is true when the variable exists. You can set it to whatever value, keep it empty, it will be always enabled if the variable exists.
Xcode scheme
UI for this setting is gone in the Xcode 11, but it can still be in the scheme file. Let's say that you have a simple project Foo. The scheme is located at Foo/Foo.xcodeproj/xcshareddata/xcschemes/Foo.xcscheme1). It's a XML file. Quit Xcode and open this file in any editor and search for the LaunchAction element.
There will be:
LaunchAction element attribute like enableAddressSanitizer = "YES"2) or
DYLD_... environment variable set.
Just remove this attribute/environment variable and you should be fine.
1) The exact path can vary, because it the scheme can be included in the workspace, project, ...
2) I don't have a previous version (10) of Xcode installed, can't check for the exact name, but it should be there and it will be obvious which one it is. This one, I used, is for the Address Sanitizer checkbox. If you find the exact name, let me know and I will update this answer or answer it yourself and I'll delete this one.
Update
Instructions above helped OP to find exact XML element names. One has to remove:
LaunchAction/AdditionalOptions/AdditionalOption elements
where the key is either DYLD_PRINT_LIBRARIES and/or DYLD_PRINT_APIS
Can someone help me understand the difference between the AssetBundleBuild.addressableNames and AssetBundleBuild.assetNames?
Also can I use BuildPipeline.BuildAssetBundles with AssetBundleBuild[] parameter to build specific asset bundles and not all of them (the overload without this parameter) ?
AssetBundleBuild.assetNames identifies the exact location and name for bundling an asset. (assume buildMap is of type AssetBundleBuild)
buildMap[0].assetNames[0] = "Assets/Textures/stinky_pupper_smol.jpg";
AssetBundleBuild.addressableNames is an optional nickname for loading the asset its array index corresponds to.
buildMap[0].addressableNames[0] = "DogTexture";
That's all done during build time so during runtime you can load that texture like this (assume bundle is of type AssetBundle):
bundle.LoadAsset("DogTexture");
instead of:
bundle.LoadAsset("Assets/Textures/stinky_pupper_smol.jpg");
For your second question, yes. The overload of BuildPipeline.BuildAssetBundles with an AssetBundleBuild[] as an argument will ignore your bundles identified in the editor:
This variant of the function lets you specify the names and contents
of the bundles using a "build map" rather than with the details set in
the editor. The map is simply an array of AssetBundleBuild objects,
each of which contains a bundle name and a list of the names of asset
files to be added to the named bundle.
I started out by writing html code in the "Default content" section but that is not meeting my requirements since all the information I want to include in the email (html) is not available.
My questions are :
How can I set an environment variable in post build actions that I can then use in the default content section ? Is that even possible ?
How can I the know the path of a file present in the workspace after the build is done. The path contains a folder that is named using timestamp and I was looking for a way to get to the build results folder for the current build easily. Is there a way ?
You can use ${ENV, var="VARNAME"} (where VARNAME is the environment variable that you want to reference) anywhere in your HTML
As for your build folder, if it's a random timestamp during the build, you can't reference it unless you save that value to a properties file and then read it with ${PROPFILE,file="FILENAME",property="PROPERTYNAME"}
If you are using Jenkins's build timestamp BUILD_ID then you can reference that as any other environment variable.
I am setting below two parameters in Config.xcconfig file to fetch appDisplayName and bundle Identifier from config file. I did my code in xcconfig file as :
appDisplayName=myapp
appIdentifier=org.prince.myapp
Set in app-Info.plist file as
Bundle identifier = ${appIdentifier}
Bundle display name =${appDisplayName}
add it to project under configurations.
It is working fine as I have given myapp as display name it is showing in simulator/device as it is.
Lets come to the point. I want to know Is there any way to change PRODUCT_NAME variable value. I set PRODUCT_NAME=custom in configuration file but this doesn't seems to work.
O yes, I have done it...
set PRODUCT_NAME=kat in Config.xcconfig file and place PRODUCT_NAME variable on
->Targets --> Build Setting -->Packaging --> Product Name as given below in screenshot
From here you can edit Bundle display name, bundle name. Double click on $[PRODUCT_NAME] then you will able to edit this.
If you want to changes PRODUCT_NAME for Localization, means if you want to change product name in different language according to device language then you can localize InfoPlist.strings file and add following in all language file -
"CFBundleDisplayName" = "Your_Product_Name";
"CFBundleName" = "Your_Product_Name";
I'm trying to add the item
<key>UIStatusBarHidden</key><true/>
to my plist that's auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; for example:
set(MACOSX_BUNDLE_ICON_FILE ${ICON})
But I can't find a way to add an arbitrary property.
I tried using the MACOSX_BUNDLE_INFO_PLIST target property as follows: I'd like the resulting plist to be identical to the old one, except with the new property I want, so I just copied the auto-generated plist and set that as my template. But the plist uses some Xcode variables, which also look like ${foo}, and CMake grumbles about this:
Syntax error in cmake code when
parsing string
<string>com.bedaire.${PRODUCT_NAME:identifier}</string>
syntax error, unexpected cal_SYMBOL,
expecting } (47)
Policy CMP0010 is not set: Bad
variable reference syntax is an error.
Run "cmake --help-policy CMP0010"
for policy details. Use the
cmake_policy command to set the
policy and suppress this warning. This
warning is for project developers.
Use -Wno-dev to suppress it.
In any case, I'm not even sure that this is the right thing to do. I can't find a good example or any good documentation about this. Ideally, I'd just let CMake generate everything as before, and just add a single extra line. What can I do?
Have you looked into copying the relevant *.plist.in file in /opt/local/share/cmake-2.8/Modules (such as MacOSXBundleInfo.plist.in), editing it to put <key>UIStatusBarHidden</key><true/> (or #VAR_TO_REPLACE_BY_CMAKE#), and adding the directory of the edited version in the CMAKE_MODULE_PATH?
If you have CMake installed as an app bundle, then the location of that file is /Applications/CMake.app/Contents/share/cmake-N.N/Modules
You can add your values using # and pass #ONLY to configure_file.
Unfortunately there is no simple way to add custom line to generated file.