fastlane基礎科普篇

iTunes Connect是一套基於 Web 的工具,專爲開發人員建立,用以提交和管理在 App Store 或 Mac App Store 上銷售的 App。html

clipboard.png

fastlane

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

Get Startedreact

安裝

brew cask install fastlane
fastlane init

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

Circle CI上安裝fastlane:android

sudo gem install fastlane -NV

配置

circle.xmlios

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配置文件git

gradle.properties:github

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.jsonjson

ci-android-deploy-setup.sh:react-native

# 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:xcode

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

相關文章
相關標籤/搜索