Waavi React Native app for iOS and Android.
brew install node
brew install watchman
npm install -g react-native-cli
- Install Xcode.
- Run:
yarn
- Running with:
yarn run ios
- Running on device: Open the project in Xcode and run in your mobile phone.
- Show developer options: Shake or cmd + d.
- React Native requires a recent version of the Java SE Development Kit (JDK). Download and install JDK 8 or newer if needed.
- Download and install Android Studio.
- You need this in your bash profile:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
- Open the project with Android Studio and install the missing SDK.
- Install genymotion, add a virtual device and go to settings > ADB > Use custom Android SDK > Browse (/Users/username/Library/Android/sdk).
- Run:
yarn
- Running with:
yarn run android
- Running on device: The same with your android mobile in Debugging Mode over USB.
- Show developer options: Shake or click the icon in genymotion device sidebar.
If need use a different environment:
- You should be created a .env file and changed props
If you need make a change in env file, youve have running the next command after updated file:
yarn refresh-dotenv
or use the watch command
yarn refresh-dotenv-watch
Use react-native-rename.
- Generating a signing key:
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 1000
- Setting up gradle variables:
- Place the my-release-key.keystore file under the android/app directory in your project folder.
- Edit the file ~/.gradle/gradle.properties and add the following (replace * with the correct keystore password, alias and key password),
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
- Edit the file android/app/build.gradle in your project folder and add the signing config:
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
- Generating the release APK:
cd android && ./gradlew assembleRelease
- Testing the release build of your app, run this command with your real device connected:
react-native run-android --variant=release
-
$ yarn bump-version 1.1.20 47
-
$ cp env/.env.master .env
-
XCode: Project Navigator: Select Canvas > Libraries > RCTFBSDK.xcodeproj > Build Settings > Framework Search Paths > Edit -> Replace "~/Documents/FacebookSDK" by "$(HOME)/Documents/FacebookSDK".
-
XCode: Product > Clean
-
XCode: Run on a simulator or device to check it's working (with backend in production)
-
(XCode: if there is a build problem with Facebook libraries... try removing everthing from ~/Library/Developer/XCode/DerivedData/)
-
XCode: Select target -> Generic iOS Device
-
XCode: Product > Archive (wait...)
-
XCode Organizer: Select the generated archive and press on "Distribute App
-
XCode Organizer: Select iOS App Store and Next
-
XCode Organizer: Select Upload and Next
-
XCode Organizer: Next (up until now, use the default config on this panel)
-
XCode Organizer: Select corresponding certificate and profile and Next
-
XCode Organizer: Upload (wait...)
-
XCode Organizer: You sould see a success screen
-
appstoreconnect: Go to App
-
appstoreconnect: Click on "Add Version" and set the version number (1.1.20)
-
appstoreconnect: Set meta info (important: "what's new" field)
-
appstoreconnect: Add the compilation (it could take a long time to be proccessed before you can select it, or even it could not appear during processing)
-
appstoreconnect: Save
-
appstoreconnect: Send to review
-
appstoreconnect: "¿Has añadido o cambiado alguna prestación de encriptación desde la última vez que enviaste esta app?" -> No
-
appstoreconnect: "¿Esta app utiliza el Identificador para publicidad (IDFA)?" -> No
-
appstoreconnect: Send
-
appstoreconnect: Wait until Apple reviews and accepts your app (tipically 1 or 2 days)
-
appstoreconnect: Publish
- Go to https://appcenter.ms/
- Find and select the app (team: WAAVI -> Apps ).
- Go to "Build" on side menu.
- Click on the branch you want to use.
- Click on "Build now"
For AppStore:
- Acceder a la consola de Google Play https://play.google.com/apps/publish
- Seleccionar la app correspondiente.
- Gestión de versiones -> Versiones de la aplicación -> Administrar gestión de producción -> Crear versión
- Añadir fichero apk.
- Rellenar -> Guardar -> revisar -> Iniciar proceso de subir a producción
For Ad Hoc test release (using Mobile Center):
- Click on "Distribute"
- Select group to distribute and "Next"
- Click on "Distribute build".
- Open XCode with an iPhone connected, run the App on the device, and stop it when you check it's working.
- Product -> Archive.
- If Organizer hasn't been opened automatically, open it manually (Window -> Organizer).
For AppStore:
- Select the app and click on "Upload to AppStore...".
- App Store distribution options -> Next (with everything checked as default)
- Select certificate and profile -> Next
- Review *.ipa -> Upload -> waiting... -> Done
- Open iTunes Connect and go to the app's panel.
- Click on "Add Version or Platform" -> fill version.
- Fill any changes.
- Wait for a long while (20 minutes?) until you can see a "plus" button next to Build option to add the build.
- Save & submit for review
- Export Compliance: No & Advertising Identifier: No -> Submit
For Ad Hoc test release (using Mobile Center):
- Select the app and click on "Export".
- Select Ad Hoc distribution.
- On "Re-sign" app options, select "Manually manage signing"
- Select certificate and profile (downloading it).
- Wait and click on "Export".
- Open the generated folder and find the .ipa file inside it.
- Go to https://appcenter.ms/
- Find and select the app (team: WAAVI -> Apps ).
- Go to "Distribute > Groups" on side menu.
- Select the group.
- Click on button "Distribut new release".
- Upload the .ipa file, and "Next" > Next > ... > "Distribute".
https://docs.microsoft.com/en-us/appcenter/distribution/codepush/react-native#getting-started
- Apple permite esto siempre que el usuario no se entere. Es decir, aunque CodePush lo permita, no se debe nunca mostrar una petición al usuario para que acepte la actualización o usar un Spinner o algo de descarga. Debe ser siempre en segundo plano.
- Apple permite injectar código (js, assets, ...) si es para bugfixes, cambios menores, features menores, .... Nunca debemos darle excusas para que consideren que es un cambio significativo.
appcenter codepush release-react -a <ownerName>/<appName> -d <deploymentName> -t <targetBinaryVersion> [-m|--mandatory] [-v|--version]
https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#releasing-updates-react-native
You can set current <ownerName>/<appName> and avoid having to write it for every command:
appcenter apps set-current WAAVI/Canvas-iOS
appcenter apps get-current