--- layout: default title: Mobile App Development parent: Development grand_parent: Miscellaneous nav_order: 9 --- # React Native Expo ## MacOS: Install watchman ``` brew install watchman ``` Run iOS on Simulator: ``` npx expo run:ios ``` Install OpenJDK for Android dev: ``` brew install openjdk@17 # Add to path sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk # Test if Java works on CLI java --version ``` Make sure NDK is installed: 1. Open Android Studio. 2. Go to: `Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools tab`. 3. Check NDK (Side by side). 4. Click Apply or OK to install it. If getting `node` errors in Android studio, close and re-open Android Studio from CLI via: ``` open -a "Android Studio" ``` ## Unit tests TODO: improve documentation further. The iOS project contains unit tests that test the `VaultStore` native Swift implementation. The `VaultStore` logic is responsible for handling vault encryption/decryption, contains the SQLite client and acts as a proxy for all local queries etc. In order to test this query logic behavior the tests contain a static encrypted client vault (SQLite database) that is provided to the tests. This static encrypted database can be (re)generated by running the `apps/server/Tests/AliasVault.E2ETests/Tests/Extensions/TestVaultGeneratorTests.cs` in the .NET solution. This E2E test generates a deterministic vault and saves it to a local temporary file. This file can then be used as the input for these unittests. ## React Native Turbo Module VaultManager The AliasVault React Native app uses the Turbo Module method for implementing the native VaultManager functionality which allows the app to store the AliasVault vault and encryption key safely on the native level enabling the use of low-level keychain secure storage methods. In order to update the Native Turbo Module scheme, edit the specs file in: `specs/NativeVaultManager.ts`. Afterwards: - For iOS, run pod install (see instructions below). Then make sure to implement the new or changed methods in the actual NativeVaultManager implementation of which the files are located in the `ios/NativeVaultManager` directory. ## Install/update Pods for iOS 1. Go to root of mobile-app directory 2. Run `npx pod-install` (don't run `pod install` directly from ios directory as this can cause errors)