Domanda

I am implementing an app which has a dependency to a command line tool.
This is because there are some presets to do.
The command line tool is responsible to create a sqlite file with all initial information needed by the app (clearly speaking: its just a tool to add some initial data to the app).

Now the problem is, that during debugging everything works fine but if I'll do a release build, some errors occur.
The first error was

target specifies product type 'com.apple.product-type.tool', but there's no such
product type for the 'iphoneos' platform"

This was because my main app had the command line tool as a target dependency. I solved this by removing the target dependency and added the build to a run script phase:

#Build the initial setup target
xcodebuild -target InitialCoreDataSetup -sdk macosx -configuration $CONFIGURATION

#Run initializing data target to get current sqlite file
cd "$CONFIGURATION_BUILD_DIR"
cd ..
cd "$CONFIGURATION"
current_dir=$(pwd)
./InitialCoreDataSetup "$current_dir" "$SRCROOT" "$CONFIGURATION"

Now the problem is, that I get the following error:

=== BUILD NATIVE TARGET InitialCoreDataSetup OF PROJECT XY WITH CONFIGURATION AdHoc     ===
Check dependencies
SDK Configuration Error: no wrapper for product type @

I have absolutely no idea how to fix this. Any suggestions?

How do you provide your app with an initial sqlite file?

Thanks in advance for any help!
EDIT At the moment the build phases of my app target are the following: enter image description here

È stato utile?

Soluzione

BTW: I finally got that working by the following line:

#Build the initial setup target
export DYLD_FRAMEWORK_PATH="$SYMROOT/Debug"
/usr/bin/env -i xcodebuild -target InitialCoreDataSetup -sdk "macosx" -configuration Debug OBJROOT="$SYMROOT/Debug" SYMROOT="$SYMROOT"
echo "$SYMROOT/Debug"
#Run initializing data target to get current sqlite file
cd "$SYMROOT/Debug"
./InitialCoreDataSetup "$SYMROOT/Debug" "$SRCROOT" "$CONFIGURATION"

The trick is to start the initialCoreDataSetup always in DEBUG mode

Altri suggerimenti

I would suggest letting Xcode do the build in this situation since you should be able to generate the sqllite file by using a build rule to run a script before the other build rules run.

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top