I have an app with multiple targets some of which have different bundle ids. I have managed to add Fabric, specifically Crashlytics to apps with the same bundle id in the past but im not sure how to go about multiple targets with different bundle ids.
Any pointers or documentation i might have missed?
You can create Crashlytics for Multiple targets in single app by adding multiple RUN SCRIPT in BUILD PHASES.
Fabric will identify based on UNIQUE RUN SCRIPT
I am working on 6 targets in single projects,getting all crashes in Fabric By target wise.
Target-->Build phases-->Add Run script
From Fabric's documentation:
To run Crashlytics with multiple targets, add a Crashlytics Run Script to each target’s Build Phase.
This worked fine for me in my projects where I have Fabric configured for both the main app target, as well on several extensions in their own targets. They ultimately show up as unique "things" in the Fabric web dashboard too which is nice.
When install Crashlytic with Firebase, for multiple scheme, you can have error Could not get GOOGLE_APP_ID in Google Services file from build environment. You can fix it by:
In Build Settings, add a user define for file name in User Defined:
In Build Phases, tap plus button, New Run Script Phase above your Crashlytic build phase, and type this code to the text field. Remember to rename %YOUR_CUSTOM_PATH_TO_FOLDER% to your path to Plist files:
GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/%YOUR_CUSTOM_PATH_TO_FOLDER%/${GOOGLE_SERVICE_INFO_PLIST_NAME}"
BUILD_APP_DIR="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
GOOGLE_SERVICE_INFO_PLIST_TO="${BUILD_APP_DIR}/GoogleService-Info.plist"
cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}"
If you are looking to implement Crashlytics in iOS for multiple targets, this is a good article by Tyler Milner.
https://medium.com/rocket-fuel/using-multiple-firebase-environments-in-ios-12b204cfa6c0
It provides a script to auto select the GoogleService-Info.plist files depending on target. You may need to slightly modify the script to reflect your app's target names, eg: "Release".
# Name of the resource we're selectively copying
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
# Get references to dev and prod versions of the GoogleService-Info.plist
# NOTE: These should only live on the file system and should NOT be part of the target (since we'll be adding them to the target manually)
GOOGLESERVICE_INFO_DEV=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Dev/${GOOGLESERVICE_INFO_PLIST}
GOOGLESERVICE_INFO_PROD=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Prod/${GOOGLESERVICE_INFO_PLIST}
# Make sure the dev version of GoogleService-Info.plist exists
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_DEV}"
if [ ! -f $GOOGLESERVICE_INFO_DEV ]
then
echo "No Development GoogleService-Info.plist found. Please ensure it's in the proper directory."
exit 1
fi
# Make sure the prod version of GoogleService-Info.plist exists
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_PROD}"
if [ ! -f $GOOGLESERVICE_INFO_PROD ]
then
echo "No Production GoogleService-Info.plist found. Please ensure it's in the proper directory."
exit 1
fi
# Get a reference to the destination location for the GoogleService-Info.plist
PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
echo "Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}"
# Copy over the prod GoogleService-Info.plist for Release builds
if [ "${CONFIGURATION}" == "Release" ]
then
echo "Using ${GOOGLESERVICE_INFO_PROD}"
cp "${GOOGLESERVICE_INFO_PROD}" "${PLIST_DESTINATION}"
else
echo "Using ${GOOGLESERVICE_INFO_DEV}"
cp "${GOOGLESERVICE_INFO_DEV}" "${PLIST_DESTINATION}"
fi
Related
I am currently testing ios application, however I have to run yarn ios -b appName and let it build and install to my simulator. I have realised that it builds to the below directory /Library/Developer/Xcode/DerivedData/myApp-aohnjxogkpanghbjzgjqryytqzqh/Build/Products/Release-iphonesimulator/myApp.app.
I would like to be able to specify the build output directory. So that I can be able to run it on every new release dynamically.
Please assist in two things
How to specify build directory when running yarn ios -b appName
How to clean the directory dynamically before dropping the new file.
I want to create two versions of an app with slightly different content. Therefore I thought about having two "www" directories (lets say "www-foo" and "www-bar") and tell capacitor in the capacitor.config.json which one to use (with "webDir" setting). Also the "appId" should be different then.
So I guessed the easiest way would be to have these capacitor.config.json files with different "appId" and "webDir" settings and when running the build script to specify which config file to use (like it's known from webpack with --config flag). But I can't find any information if it's possible to specify the config file to use for building the app.
Is it just not possible (yet) or am I too stupid to find it? :)
Otherwise I would try to create the capacitor.config.json file with webpack before running the capacitor build script.
I used this article as a guide for my project.
I don't know if exist any option for two or more AppID/webDir in Capacitor.
But understanding you necessity my suggest is create a custom build script in Node.js that change info in capacitor.config.ts (appId) > build (www/www-Two) > sync & copy to platform
I'm trying to load and unload modules using modprobe but I'm having problems. The command fails with "modprobe:
can't change directory to '/lib/modules': no such file or directory"
There is actually no /lib/modules directory on the image at all.
PS : I used yocto project to build Linux os image and I'm using the 3.14 kernel.
Any help would be appreciated!
Probably you just don't have any modules installed. Add
IMAGE_INSTALL += "kernel-modules"
to your image recipe.
Update:
If this does not add the modules to the image, your next steps to check are:
Check if there actually any modules built. Not all kernel configurations actually do this. An easy way is to look into the tmp/deploy/... directory that holds your generated packages.
Check if the setting actually gets propagated to the iamge. bitbake -e on your image will tell, grep for IMAGE_INSTALL.
Update 2:
For 1) All built kernel-modules are automatically packaged in packages starting with "kernel-module-". So if there is no package bearing that prefix and the module name you expect, then its not a problem of installing, but a problem of your kernel or kernel config not building the module at all.
For 2) "I can't read it all": Thats why I explicitly said "grep for IMAGE_INSTALL" - you shall not read it all, just see if that variable actually includes "kernel-modules".
Well I found the solution:
In fact
IMAGE_INSTALL += "kernel-modules"
Does not add modules folder under /lib . It does not work wiTh YOCTO PROJECT SUMO release. I added this
CORE_IMAGE_EXTRA_INSTALL += " kernel-modules"
to my local.conf and now the /lib/modules is found and kernel-modules are packaged
I got an application what we white-label for others.
This means we share the same functionality through the apps but there are some specific design elements (mostly colors and pictures) in each app.
I'm looking for the easiest and best way to identify the built app for my Expo React Native codebase.
My plan is store everything in the same javascript codebase, and just get load the correct config files by the application name.
In this case, I would get a few apps in the stores:
BlueApp
RedApp
GreenApp
All of them would load the same expo app: exp.host/#comp/colours
And this expo app should set the background to blue in the BlueApp and red in the RedApp.
! I don't want to detach my expo app, I want to still build my apps with the expo.
It is possible to use a different configuration file by doing expo start --config=some-app.json. One problem I ran into is that some assets were still being required at a specific location (eg. assets/images/icon.png).
The solution I came up with is to switch the project, via a bash script, every time you start a project. That way, the development you run you will also publish without fussing around config parameters that expo may or may not support.
So in your package.json you can have run commands which look like this:
./switch project1 && expo start
The bash script would sync all assets from src directory, including app.json to their expected paths. The directory structure would looks like this:
src
- project1
- app.json
- assets
- project2
- app.json
- assets
and the script:
#!/bin/bash
if [ $1 == "swaggr" ] || [ $1 == "chatsera" ]
then
echo "switching to $1"
unlink app.json
cp ./src/$1/app.json ./app.json
rsync -rvz ./src/$1/assets/ ./assets/
else
echo "could not switch project. $1 is invalid"
fi
If you use this approach I'd probably add app.json and all assets in .gitignore.
I'm not sure if i understood you correctly but i kinda think of a solution.
I don't know if this is the best way.
You can use release channels to create 3 different version of the same code. Than you can load config for the channel using Expo.Constants.manifest.releaseChannel.
for more information https://docs.expo.io/versions/latest/distribution/release-channels
We have a project where the .js and .css files gets compressed with YUI Compressor. A very good tool. We also use TFS 2010 as a build server with nightly builds that also deploys to our dev web site.
The problem we're having is that the file YUI generates causes a "Access denied"-problem. This is because there already is such a file generated from before, and that it's a part of the project, making it read-only. We can however remove it from the project and it should create fine. The problem then is that the generated file doesnt get included in the actual deploy package.
Locally i have no problem because i have a pre build event command script, which deletes the existing files. This apparently doesnt work on the build server. Maybe the tfs context user lacks permission, i dont know.
Is there anyone who might have had similiar problems?
Update 21/11:
The question may be abit vague. To simplify, lets just say i want this to work as it does locally:
IF NOT $(ConfigurationName) == DEBUG DEL "$(ProjectDir)Styles\styles.min.css
IF NOT $(ConfigurationName) == DEBUG DEL "$(ProjectDir)JavaScript\script.min.js
This is defined in the pre-build command event line, under Project properties -> Build events.
The script removes the files before the YUI-file generation, and thus there is no file to overwrite. Could it be that simple that the user context that executes the TFS-build have insufficent modify rights?
SOLUTION:
We ended up with the following code in the pre-build event:
attrib -r "$(ProjectDir)Styles\styles.min.css"
attrib -r "$(ProjectDir)JavaScript\script.min.js"
IF NOT $(ConfigurationName) == Debug $(MSBuildBinPath)\msbuild.exe "$(ProjectDir)Config\MSBuild\BuildSettings.xml"
/Mattias
If the files are part of your project and downloaded from the TFS repository, first always remove te read-only flag if your need to do any processing on them, for example deletion. So in your script, first do:
attrib -r *.js
attrib -r *.css
Should be able to delete them fine after that. It is probably not a permission issue, since the account that is used to download the files is also the account used to delete them.