# Install project dependencies
poetry install
# Activate Poetry shell
poetry shell
# Install Java using Homebrew
brew install --cask oracle-jdk
# Verify Java installation
java -version
# Install Node.js
brew install node
# Install Appium
npm install -g appium
# Install Appium Driver
appium driver install uiautomator2
- Install Android Studio:
brew install --cask android-studio
-
Android SDK Components (through Android Studio):
- Launch Android Studio
- Click "More Actions" (or "Tools")
- Select "SDK Manager"
- In "SDK Tools" tab, check:
- "Android SDK Command-line Tools"
- "Android SDK Platform-Tools"
- "Android Emulator"
- Click "Apply" and wait for installation
-
Set Environment Variables: Add to
~/.zshrc
:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
- Apply changes:
source ~/.zshrc
- Verify setup:
adb version
# Create apps directory in project root
mkdir apps
cd apps
# Download API Demos APK
curl -L -o ApiDemos-debug.apk https://github.com/appium/appium/raw/master/packages/appium/sample-code/apps/ApiDemos-debug.apk
mobile_testing/
├── pyproject.toml
├── tests/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_app.py
└── apps/
└── ApiDemos-debug.apk
The test framework will automatically:
- Create and manage Android Virtual Devices
- Start/stop the emulator as needed
- Handle Appium server lifecycle
- Run the tests in the configured environment
Simply run:
pytest tests/
-
"Unable to locate a Java Runtime"
- Install Java:
brew install --cask oracle-jdk
- Verify installation:
java -version
- Install Java:
-
"Android SDK cmdline-tools not found"
- Open Android Studio → SDK Manager
- Select "SDK Tools" tab
- Check "Android SDK Command-line Tools"
- Click "Apply"
-
"adb: command not found"
- Verify environment variables in ~/.zshrc
- Check if platform-tools is installed in SDK Manager
-
System Image Issues
- Test framework will handle downloading and installing required system images
- If you see permission issues, run Android Studio once to accept licenses