在 app.config.ts 添加注册
变量 process.env.TARO_ENV === 'h5' 'rn' 'weapp'
编译判断
/* #ifdef rn */
只有rn有;
/* #endif */
/* #ifndef rn */
只有rn没有;
/* #endif */
文件后缀匹配 index.tsx index.rn.tsx
install peerDependencies of
@tarojs/taro-rn
@tarojs/components-rn
and@tarojs/router-rn
, it will also runpost-install
. please modify and runupgradePeerdeps
script when you change taro version.run this script after project inited.
pnpm upgradePeerdeps
run this script when you add new react native library or update react native library version.
see pod-install for more infomation.
pnpm podInstall
pnpm ios
pnpm android
pnpm start
pnpm build:rn --platform ios
pnpm build:rn --platform android
see publishing-to-app-store for details.
see signed-apk-android for details.
use github actions to build your apps. this template include basic github action config.
see .github/workflows for details.
we assemble debug and release product for both android and ios when you push or pull request on master branch by default. design your own workflows by modify .github/workflows files.
see events-that-trigger-workflows
Modify the following configuration items for package and publish your app.
.github/workflows/assemble_ios_debug.yml > .github/workflows/assemble_ios_release.yml
env:
APP_ID: com.taro.demo # Application Product Bundle Identifier
APP_NAME: Taro Demo # The Display Name of your app
VERSION_NUMBER: 1.0.0 # Application version number
BUILD_NUMBER: 1.0.0.0 # Application build number, used by release only.
TEAM_ID: XXXXXXXXXX # Team ID, is used when upgrading project
PROVISIONING_PROFILE_SPECIFIER: Product_profile # Provisioning profile name to use for code signing
CODE_SIGN_IDENTITY: iPhone Distribution # Code signing identity type (iPhone Developer, iPhone Distribution)
SIGNING_CERTIFICATE_P12_DATA: ${{secrets.RELEASE_SIGNING_CERTIFICATE_P12_DATA}}
SIGNING_CERTIFICATE_PASSWORD: ${{secrets.RELEASE_SIGNING_CERTIFICATE_PASSWORD}}
PROVISIONING_PROFILE_DATA: ${{secrets.RELEASE_PROVISIONING_PROFILE_DATA}}
APP_STORE_CONNECT_USERNAME: ${{secrets.APP_STORE_CONNECT_USERNAME}} # This secret should be set to the Apple ID of your developer account, used by release only.
APP_STORE_CONNECT_PASSWORD: ${{secrets.APP_STORE_CONNECT_PASSWORD}} # used by release only.
values like ${{secrets.xxxxx}} are manually generated and store in your github encrypted secrets.
cat Certificates.p12 | base64 | pbcopy
encryption password of your Personal Information Exchange (.p12)
cat profile.mobileprovision | base64 | pbcopy
This secret should be set to an application-specific password for your Apple ID account. Follow these instructions to create an application-specific password.
Modify the following configuration items for package and publish your app.
.github/workflows/assemble_android_debug.yml > .github/workflows/assemble_android_release.yml
env:
APP_ID: com.taro.demo # Application Product Bundle Identifier
APP_NAME: Taro Demo # The Display Name of your app
APP_ICON: ic_launcher # The Application icon of your app
APP_ROUND_ICON: ic_launcher_round # The Application round icon of your app
APP_ABI_FILTERS: armeabi-v7a, arm64-v8a # App abi filters
VERSION_NAME: 1.0.0 # version name
VERSION_CODE: 10 # version code
KEYSTORE_FILE: debug.keystore # key store file
KEYSTORE_PASSWORD: android # key store password
KEYSTORE_KEY_ALIAS: androiddebugkey # key store key alias
KEYSTORE_KEY_PASSWORD: android # key store key password
For the security of your app, please regenerate the .keystore file and store the password in your github encrypted secrets.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。