0

Sorry, I'm very new to iOS development.

I'm building a Cordova/Meteor app. Meteor creates a build directory, and I'd like a command line script to build the binary to upload to itunesconnect.

Here's what I have so far:

#!/bin/bash

CODE_SIGN_IDENTITY="Michael"
NAME="appExpertAlerts"

# Create the xcode project
meteor add-platform ios
echo "STARTING BUILD"
meteor build ../../ops/production/ios \
  --mobile-settings ../../ops/production/meteor/settings.json \
  --server https://phone.app.io:443 \
  --verbose
meteor remove-platform ios
popd

# Build the xcode project
pushd ios/ios/project
xcodebuild \
  build \
  -sdk iphoneos \
  -configuration Release \
  -xcconfig cordova/build.xcconfig \
  -project "$NAME.xcodeproj" \
  -target "$NAME" \
  SHARED_PRECOMPS_DIR=$(pwd)/build/sharedpch \
  CODE_SIGN_IDENTITY="$CODE_SIGN_IDENTITY" \
  ARCHS="armv7 armv7s arm64" \
  VALID_ARCHS="armv7 armv7s arm64" \
  CONFIGURATION_BUILD_DIR=$(pwd)/build/device \

popd

The build says it's a success, and I can see output files, but I can't find the binary to upload to itunesconnect.

Where is the output binary? Or how do I create one?

Michael Cole
  • 15,473
  • 7
  • 79
  • 96

1 Answers1

0

I have not yet implemented an automation of the build-upload to itunesconnect, sounds interesting :-)

Yet, after the build has been triggered, I think, what you try to achieve would be better implemented as a "run script" build phase. There you have the variables set as described here:

https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW42

Especially interesting for you should be TARGET_BUILD_DIR:

TARGET_BUILD_DIR

Description: Directory path. Identifies the root of the directory hierarchy that contains the product’s files (no intermediate build files).

Run Script build phases that operate on product files of the target that defines them should use the value of this build setting. But Run Script build phases that operate on product files of other targets should use BUILT_PRODUCTS_DIR instead.

Example values: /Volumes/Users/genica/MyProject/build/Debug /tmp/MyProject.dst/Users/genica/Applications /Volumes/Users/genica/MyProject/build/UninstalledProducts Related to: DEPLOYMENT_LOCATION (Deployment Location), INSTALL_PATH (Installation Directory), SKIP_INSTALL.

The variables can be accessed as ${VAR NAME} in your script.

The .ipa archive can be created as shown in this SO article: Xcode "Build and Archive" from command line

You may pay special attention to the shenzen tool, which is, if I understand you correctly, exactly what you are currently building. https://github.com/nomad/shenzhen

Community
  • 1
  • 1
thst
  • 4,592
  • 1
  • 26
  • 40