Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.84 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.84 KB

aptos-rust-bindings

Generating Mobile Bindings for Android and iOS

To generate mobile bindings for Android and iOS, follow these steps:

  1. Navigate to the aptos-mobile folder.

  2. Inside the aptos-mobile directory, locate the subdirectories that contain the platform-specific binding scripts.

  3. Run the respective scripts for each platform:

    • Android: Execute build-android.sh in each subdirectory.
      ./build-android.sh
    • iOS: Execute build-ios.sh in each subdirectory.
      ./build-ios.sh
  4. Repeat the above steps for all subdirectories within the aptos-mobile folder.

These scripts will generate the necessary bindings and artifacts for the respective platforms, making the mobile integration seamless.

Generating WASM Bindings

To generate WASM bindings, follow these steps:

  1. Navigate to the aptos-wasm folder.

  2. Inside the aptos-wasm directory, locate the subdirectories that contain the platform-specific scripts for WASM generation.

  3. Run the respective scripts for each platform:

    • macOS: Ensure Docker is installed on your machine, then execute build-wasm.sh in each subdirectory.

      ./build-wasm.sh
    • Linux: Use wasm-pack to build the bindings in each subdirectory by running the following command:

      wasm-pack build --release --target web -d "$dir/pkg"

      Replace $dir with the name of the specific subdirectory you are working in.

  4. Once WASM bindings have been generated in all subdirectories, you can create a unified package by running the gen-npm-pkg.sh script at the root of the project:

    ./gen-npm-pkg.sh

These steps will generate the necessary WASM bindings and artifacts for the respective platforms, providing a seamless integration experience.