我正在使用cordova应用程序,我设法使用脚本从命令行创建ipa。
echo "" > $PROJECT_DIR/cordova/build.xcconfig
echo "CODE_SIGN_IDENTITY = iPhone Distribution: XXXXXXX" >> $PROJECT_DIR/cordova/build.xcconfig
echo "CODE_SIGN_RESOURCE_RULES_PATH = \$(SDKROOT)/ResourceRules.plist" >> $PROJECT_DIR/cordova/build.xcconfig
echo "IPHONEOS_DEPLOYMENT_TARGET = 7.0" >> $PROJECT_DIR/cordova/build.xcconfig
cordova build ios --device
xcrun \
-sdk iphoneos PackageApplication \
-v "$PRODUCT_DIR/$TARGET.app" \
-o "$OUTDIR/$TARGET.ipa" \
--embed "$PROVISONING_PROFILE" \
--sign "$IDENTITY"
这很好用,但是当我上传到Apple TestFlight时,我收到此警告。
你们对此有任何暗示吗?也许我可以在.xcconfig
添加一行似乎非常方便!
答案 0 :(得分:5)
我想错了! --release
标志丢失了。现在我可以在不打开XCode的情况下构建!
echo "\n > patching cordova xconfig for distribution\n"
echo "" > $PROJECT_DIR/cordova/build.xcconfig
echo "CODE_SIGN_IDENTITY = $IDENTITY" >> $PROJECT_DIR/cordova/build.xcconfig
echo "CODE_SIGN_RESOURCE_RULES_PATH = \$(SDKROOT)/ResourceRules.plist" >> $PROJECT_DIR/cordova/build.xcconfig
echo "IPHONEOS_DEPLOYMENT_TARGET = 7.0" >> $PROJECT_DIR/cordova/build.xcconfig
echo "\n > cleanup $OUTDIR/$TARGET.ipa\n"
rm -vf $OUTDIR/$TARGET.ipa
echo "\n > build project\n"
cordova build ios --release --device
echo "\n > creating ipa at $OUTDIR/$TARGET.ipa\n"
cd $BASE_DIR
xcrun \
-sdk iphoneos PackageApplication \
-v "$PRODUCT_DIR/$TARGET.app" \
-o "$OUTDIR/$TARGET.ipa" \
--embed "$PROVISONING_PROFILE" \
--sign "$IDENTITY"