fastlane基础科普篇

hbblzjy 2019-06-21

iTunes Connect是一套基于 Web 的工具,专为开发人员创建,用以提交和管理在 App Store 或 Mac App Store 上销售的 App。

fastlane基础科普篇

fastlane

a collection of tools that help you automate building and releasing iOS and Android apps

Get Started

安装

brew cask install fastlane
fastlane init

.zshrc:
export PATH="$HOME/.fastlane/bin:$PATH”

Circle CI上安装fastlane:

sudo gem install fastlane -NV

配置

circle.xml

dependencies:
  pre:
    # Install Gems (fastlane, etc)
    - bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 --without development

打包APK,生成一个签名秘钥,设置gradle变量,添加签名到项目的gradle配置文件

gradle.properties:

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=P@ss123456
MYAPP_RELEASE_KEY_PASSWORD=P@ss123456

申请Google开发者账号,然后生成秘钥JSON文件,下载后放在项目脚本文件中google-play-android-secret.json

ci-android-deploy-setup.sh:

# copy keystore properties
mkdir -p ~/.gradle
cp ./bin/gradle.properties ~/.gradle/gradle.properties

# ensure licenses are already accepted
mkdir -p $ANDROID_HOME/licenses
cp ./android/fastlane/android-sdk-license $ANDROID_HOME/licenses

circle.xml:

deployment:
  beta:
    branch: VM-9
    commands:
      - ./bin/ci-android-deploy-setup.sh
      # Build and deploy Android app
      - cd android && bundle exec fastlane android beta
      # Make it can load script from assets 'index.android.bundle'
      - node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
      # Upload a debug build
      - cd android && ./gradlew testFairyDebug
      # Build and deploy IOS app
      - cd ios && bundle exec fastlane ios beta

Android and IOS

if [ $CONFIGURATION == Release ]; then
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
#increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
fi
buildnum=$(expr $buildnum + 1)
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}"
echo "Bumped build number to $buildnum"
else
echo $CONFIGURATION " build - Not bumping build number."
fi

通过TestFairy或TestFlight等工具将潜在的新版本发布给beta测试人员。

TestFlight

苹果已经将Tesflight集成到itunesconnect中,TestFlight支持iOS 8及以上版本。在我们删除iOS 7支持之前,我们将使用Crashlytics进行所有beta测试。

TestFairy

TestFairy is a mobile beta testing platform for enterprise, providing developers with videos showing users behavior on mobile apps.

Q1: unable to load scripts from assets 'index.android.bundle' on real device:

A1: This issue occur on real device because the JS bundle is located on your development system and the app inside your real device is not aware of it's location

相关推荐