Skip to content

Instantly share code, notes, and snippets.

@VehpuS
Last active February 1, 2023 22:34
Show Gist options
  • Select an option

  • Save VehpuS/1eb5143cdb6013fbc0d2b8ec52f5059b to your computer and use it in GitHub Desktop.

Select an option

Save VehpuS/1eb5143cdb6013fbc0d2b8ec52f5059b to your computer and use it in GitHub Desktop.

Revisions

  1. VehpuS revised this gist May 25, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -110,7 +110,7 @@ To see it's contents, rename it to out_bundle_archive_set.zip and extract the zi
    ##### How to generate an apks file with the debug credentials
    `java -jar bundletool.jar build-apks --bundle=./\@anonymous\\travienceplan-56f3d7aeb07a4acf817e0d992c516610-signed.aab --output=./travience.apks --ks=../../../../debug.keystore --ks-pass=pass:android --key-pass=pass:android --ks-key-alias=androiddebugkey --mode=universal`
    `java -jar bundletool.jar build-apks --bundle=./\@anonymous\\app-56f3d7aeb07a4acf817e0d992c516610-signed.aab --output=./app.apks --ks=../../../../debug.keystore --ks-pass=pass:android --key-pass=pass:android --ks-key-alias=androiddebugkey --mode=universal`
    ###### When not using --mode=universal
  2. VehpuS revised this gist Mar 3, 2021. 1 changed file with 2 additions and 5 deletions.
    7 changes: 2 additions & 5 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -83,8 +83,8 @@ If the build finishes successfully you will find the path to the build artifact
    If you want to print the list of all available command arguments, please run turtle build:android --help.
    #### For debugging
    EXPO_ANDROID_KEYSTORE_PASSWORD=android EXPO_ANDROID_KEY_PASSWORD=android turtle build:android --keystore-path ./debug.keystore --keystore-alias androiddebugkey --public-url=http://localhost:5000/android-index.json
    Compiling to APK directly:
    `EXPO_ANDROID_KEYSTORE_PASSWORD=android EXPO_ANDROID_KEY_PASSWORD=android turtle build:android -m \"debug\" --keystore-path ./debug.keystore --keystore-alias androiddebugkey --public-url=https://ecf8933f.ngrok.io/android-index.json -c ./app.json -t apk`
    This generates an android app bundle in ~/expo-apps/
    @@ -139,9 +139,6 @@ Read through on the command format in "[deploy APKs to a connected device](https
    Continue with steps 5 onwards
    Compiling to APK directly:
    `EXPO_ANDROID_KEYSTORE_PASSWORD=android EXPO_ANDROID_KEY_PASSWORD=android turtle build:android -m \"debug\" --keystore-path ./debug.keystore --keystore-alias androiddebugkey --public-url=https://ecf8933f.ngrok.io/android-index.json -c ./app.json -t apk`
    ## Additional resources
    ### Blog reference
  3. VehpuS revised this gist Mar 3, 2021. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -139,6 +139,9 @@ Read through on the command format in "[deploy APKs to a connected device](https
    Continue with steps 5 onwards
    Compiling to APK directly:
    `EXPO_ANDROID_KEYSTORE_PASSWORD=android EXPO_ANDROID_KEY_PASSWORD=android turtle build:android -m \"debug\" --keystore-path ./debug.keystore --keystore-alias androiddebugkey --public-url=https://ecf8933f.ngrok.io/android-index.json -c ./app.json -t apk`
    ## Additional resources
    ### Blog reference
  4. VehpuS revised this gist Dec 24, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -106,11 +106,11 @@ This command will generate an APK set for all device configurations your app sup
    To see it's contents, rename it to out_bundle_archive_set.zip and extract the zip file, jump into the folder out_bundle_archive_set > standalones, where you will seee a list of all the apks.
    --mode=universal ensures that the generated apks set includes a universal apk, which can be used to install the app directly on any android device - so it's ideal for testing purposes (after that - we'll just use the aab in the google play store).
    `--mode=universal` ensures that the generated apks set includes a universal apk, which can be used to install the app directly on any android device - so it's ideal for testing purposes (after that - we'll just use the aab in the google play store).
    ##### How to generate an apks file with the debug credentials
    java -jar bundletool.jar build-apks --bundle=./\@anonymous\\travienceplan-56f3d7aeb07a4acf817e0d992c516610-signed.aab --output=./travience.apks --ks=../../../../debug.keystore --ks-pass=pass:android --key-pass=pass:android --ks-key-alias=androiddebugkey --mode=universal
    `java -jar bundletool.jar build-apks --bundle=./\@anonymous\\travienceplan-56f3d7aeb07a4acf817e0d992c516610-signed.aab --output=./travience.apks --ks=../../../../debug.keystore --ks-pass=pass:android --key-pass=pass:android --ks-key-alias=androiddebugkey --mode=universal`
    ###### When not using --mode=universal
  5. VehpuS revised this gist Dec 24, 2019. 1 changed file with 135 additions and 4 deletions.
    139 changes: 135 additions & 4 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -2,22 +2,153 @@

    I made this because each doc on it's own discusses localizing one part of the pipeline - and I couldn't find a single place to see the whole process.

    ## From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)
    ## Project set up + app.json

    From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Do steps 1, 2

    ## From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)
    ## Host the generated app's files

    From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)

    Make sure to use localhost public url method, as otherwise anyone can build (and see dist files) for project.

    Make sure to use localhost public url method, as otherwise anyone can build (and see dist files) for project
    ## App Signing

    ## From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)
    From [this documentation](https://docs.expo.io/versions/latest/distribution/app-signing/)

    Get certificates required for android / IOS

    ### IOS

    - sign up as developer

    ### Android

    https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore

    - For [debugging](https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores): `keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000`

    - Keystore name: "debug.keystore"
    - Keystore password: "android"
    - Key alias: "androiddebugkey"
    - Key password: "android"
    - CN: "CN=Android Debug,O=Android,C=US"

    - This is generated by answering:

    ```
    What is your first and last name?
    [Unknown]: Andoird Debug
    What is the name of your organizational unit?
    [Unknown]:
    What is the name of your organization?
    [Unknown]: Android
    What is the name of your City or Locality?
    [Unknown]:
    What is the name of your State or Province?
    [Unknown]:
    What is the two-letter country code for this unit?
    [Unknown]: US
    Is CN=Andoird Debug, OU=Unknown, O=Android, L=Unknown, ST=Unknown, C=US correct?
    ```
    ## From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)
    Build locally from hosted source with local keys using turtle-cli
    Remember to serve the exported build on an http/s server first (see prior steps).
    ### Android
    Before starting the build, prepare the following things:
    - Keystore
    - Keystore alias
    - Keystore password and key password
    Set the EXPO_ANDROID_KEYSTORE_PASSWORD and EXPO_ANDROID_KEY_PASSWORD environment variables with the values of the keystore password and key password, respectively.
    Then, start the standalone app build:
    ```
    $ turtle build:android \
    --keystore-path /path/to/your/keystore.jks \
    --keystore-alias PUT_KEYSTORE_ALIAS_HERE
    ```
    If the build finishes successfully you will find the path to the build artifact in the last line of the logs.
    If you want to print the list of all available command arguments, please run turtle build:android --help.
    #### For debugging
    EXPO_ANDROID_KEYSTORE_PASSWORD=android EXPO_ANDROID_KEY_PASSWORD=android turtle build:android --keystore-path ./debug.keystore --keystore-alias androiddebugkey --public-url=http://localhost:5000/android-index.json
    This generates an android app bundle in ~/expo-apps/
    #### Generating apks from the Android App Bundle locally using bundle-tools
    From [this stackoverflow question](https://stackoverflow.com/questions/50419286/install-android-app-bundle-on-device), [this stackoverflow question](https://stackoverflow.com/questions/54507637/how-to-join-multiple-apks-and-build-a-universal-apk-with-google-app-bundle) and [this documentation article](https://developer.android.com/studio/command-line/bundletool):
    You cannot install app bundle [NAME].aab directly to android device because it is publishing format, but there is way to extract the required apk from bundle and install it to you device, the process is as follow
    Download app bundletool from here run it in you terminal.
    If you want to deploy the APKs to a device, you need to include your app’s signing information, as shown in the command below. If you do not specify signing information, bundletool attempts to sign your APKs with a debug key for you.
    Command format:
    `bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks --ks=/MyApp/keystore.jks --ks-pass=file:/MyApp/keystore.pwd --ks-key-alias=MyKeyAlias --key-pass=file:/MyApp/key.pwd --mode=universal`
    This command will generate an APK set for all device configurations your app supports from your app bundle - bundletool generates APKs from your app bundle in a container called an APK set archive, which uses the .apks file extension.
    To see it's contents, rename it to out_bundle_archive_set.zip and extract the zip file, jump into the folder out_bundle_archive_set > standalones, where you will seee a list of all the apks.
    --mode=universal ensures that the generated apks set includes a universal apk, which can be used to install the app directly on any android device - so it's ideal for testing purposes (after that - we'll just use the aab in the google play store).
    ##### How to generate an apks file with the debug credentials
    java -jar bundletool.jar build-apks --bundle=./\@anonymous\\travienceplan-56f3d7aeb07a4acf817e0d992c516610-signed.aab --output=./travience.apks --ks=../../../../debug.keystore --ks-pass=pass:android --key-pass=pass:android --ks-key-alias=androiddebugkey --mode=universal
    ###### When not using --mode=universal
    - Loading apks to emulator
    Also from [deploy APKs to a connected device](https://developer.android.com/studio/command-line/bundletool)
    After you generate a set of APKs, bundletool can deploy the right combination of APKs from that set to a connected device.
    For example, if you have a connected device running Android 5.0 (API level 21) or higher, bundletool pushes the base APK, dynamic feature APKs, and configuration APKs required to run your app on that device. Alternatively, if your connected device is running Android 4.4 (API level 20) or lower, bundletool looks for a compatible multi-APK and deploys it to your device.
    To deploy your app from an APK set, use the install-apks command and specify the path of the APK set using the --apks=/path/to/apks flag, as shown below. (If you have multiple devices connected, specify a target device by adding the --device-id=serial-id flag.)
    `bundletool install-apks --apks=/MyApp/my_app.apks`
    - Creating APK for a specific device from apks
    Read through on the command format in "[deploy APKs to a connected device](https://developer.android.com/studio/command-line/bundletool)"
    - [Getting device info](https://www.howtogeek.com/339665/how-to-find-your-android-devices-info-for-correct-apk-downloads/)
    - [SDK version from OS version](https://source.android.com/setup/start/build-numbers)
    `bundletool extract-apks --apks=/MyApp/my_existing_APK_set.apks --output-dir=/MyApp/my_pixel2_APK_set.apks --device-spec=/MyApp/bundletool/pixel2.json`
    ## From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)
    Continue with steps 5 onwards
    ## Additional resources
    ### Blog reference
    https://www.robincussol.com/build-standalone-expo-apk-ipa-with-turtle-cli/
    ### Expo Turtle CLI usage example
    https://github.com/expo/turtle-cli-example
    ### Fastlane docs
    https://docs.fastlane.tools/
  6. VehpuS revised this gist Dec 18, 2019. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -2,22 +2,22 @@

    I made this because each doc on it's own discusses localizing one part of the pipeline - and I couldn't find a single place to see the whole process.

    # From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)
    ## From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Do steps 1, 2

    # From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)
    ## From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)

    Make sure to use localhost public url method, as otherwise anyone can build (and see dist files) for project

    # From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)
    ## From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)

    Get certificates required for android / IOS

    # From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)
    ## From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)

    Build locally from hosted source with local keys using turtle-cli

    # From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)
    ## From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Continue with steps 5 onwards
  7. VehpuS revised this gist Dec 18, 2019. 1 changed file with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,23 @@
    # A Summary of Documents on How to Build Expo Locally

    I made this because each doc on it's own discusses localizing one part of the pipeline - and I couldn't find a single place to see the whole process.

    From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/) Do steps 1, 2
    # From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Do steps 1, 2

    From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)
    # From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)

    Make sure to use localhost public url method, as otherwise anyone can build (and see dist files) for project

    From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)
    # From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)

    Get certificates required for android / IOS

    From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)
    # From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)

    Build locally from hosted source with local keys using turtle-cli

    From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)
    # From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Continue with steps 5 onwards
  8. VehpuS created this gist Dec 18, 2019.
    20 changes: 20 additions & 0 deletions expo-local-build-nodes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # A Summary of Documents on How to Build Expo Locally
    I made this because each doc on it's own discusses localizing one part of the pipeline - and I couldn't find a single place to see the whole process.

    From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/) Do steps 1, 2

    From [Hosting Your App](https://docs.expo.io/versions/v36.0.0/distribution/hosting-your-app/)

    Make sure to use localhost public url method, as otherwise anyone can build (and see dist files) for project

    From [App Signing](https://docs.expo.io/versions/latest/distribution/app-signing/)

    Get certificates required for android / IOS

    From [Building Standalone Apps on Your CI](https://docs.expo.io/versions/v36.0.0/distribution/turtle-cli/)

    Build locally from hosted source with local keys using turtle-cli

    From [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps/)

    Continue with steps 5 onwards