Welcome to the React App with Expo project! Follow the steps below to set up the project on your local Mac machine. You can use the doc here: https://docs.expo.dev/get-started/set-up-your-environment/?mode=development-build&buildEnv=local
Before you begin, make sure you have the following installed on your Mac:
- Node.js (version 20 or higher)
- https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating ( use this to install node version )
- npm (comes with Node.js)
- Expo CLI
First, you need to clone the project repository from GitHub. Open your terminal and run the following command:
git clone https://github.com/Newton-School/adv-course-assignment.git
Change to the project directory using the cd
command:
cd your-repo-name
Install the necessary dependencies using npm
:
npm install
Start the Expo development server by running:
npx expo start
- Make sure you have Xcode installed from the Mac App Store.
- click on the
Run on iOS simulator
button in the Expo development tools.
- Download the Expo Go app from the App Store on your iOS device.
- Scan the QR code displayed in the Expo development tools with the Expo Go app.
- Download and install Android Studio.
- Open Android Studio and follow the setup wizard to install the necessary SDK tools.
- Create a new virtual device (AVD) by going to
AVD Manager
>Create Virtual Device
. - Select a device definition and click
Next
. - Choose a system image (ensure it's an x86 image for better performance) and click
Next
. - Verify the configuration and click
Finish
to create the AVD. - Start the AVD by clicking the
Play
button in theAVD Manager
. - click on the
Run on Android device/emulator
button in the Expo development tools.
- Enable Developer Options and USB Debugging on your Android device:
- Go to
Settings
>About phone
and tapBuild number
seven times to enable Developer Options. - Go to
Settings
>Developer options
and enableUSB debugging
.
- Go to
- Connect your Android device to your Mac via USB.
- click on the
Run on Android device/emulator
button in the Expo development tools. - Follow the prompts on your Android device to allow USB debugging and install the Expo Go app.
- The app should now run on your connected Android device.
Follow these steps to build your Android app locally.
Ensure you have the following tools installed:
Create an account https://expo.dev/ [expo dev]
# 1. Install `eas-cli` Globally
npm install --global eas-cli
# 2. Set Default Node.js Version Using `nvm`
nvm alias default 20
# 3. Install `bundletool` via Homebrew
brew install bundletool
# 4. Generate a Keystore (if you haven't already)
keytool -genkeypair -v -keystore ./keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias keyAlias
# 5. Build the Android App Locally
eas build --platform android --local
# 6. Generate APKs Using `bundletool`
bundletool build-apks --bundle=path/to/your_app.aab --output=path/to/your_app.apks --mode=universal --ks=./keystore.jks --ks-key-alias=keyAlias --ks-pass=pass:test123
# 7. Install the APKs Using `bundletool`
bundletool install-apks --apks=path/to/your_app.apks
# 8. Clean Up Generated Files
rm -rf path/to/your_app.apks