This guide covers setting up Android and Linux ARM devices for benchmarking with OVMobileBench.
- Android Device Setup
- Linux ARM Device Setup
- Device Stabilization
- Performance Tuning
- Multiple Device Setup
- Troubleshooting
- Android device with ARM64 processor
- USB cable for connection
- Android SDK Platform Tools installed on host
- Go to Settings → About Phone
- Tap Build Number 7 times
- Enter your PIN/password if prompted
- Developer Options will appear in Settings
- Go to Settings → Developer Options
- Enable Developer Options toggle
- Enable USB Debugging
- (Optional) Enable Stay Awake to keep screen on while charging
- Connect device via USB cable
- Select File Transfer or MTP mode
- Accept the RSA fingerprint dialog on device
# List connected devices
adb devices
# Expected output:
# List of devices attached
# R3CN30XXXX device
# Get device information
adb shell getprop ro.product.model
adb shell getprop ro.product.cpu.abi
adb shell getprop ro.build.version.release# Create working directory
adb shell mkdir -p /data/local/tmp/ovmobilebench
# Verify write permissions
adb shell touch /data/local/tmp/ovmobilebench/test.txt
adb shell rm /data/local/tmp/ovmobilebench/test.txt
# Check available storage
adb shell df -h /data/local/tmpdevice:
kind: "android"
serials: ["R3CN30XXXX"] # From 'adb devices'
push_dir: "/data/local/tmp/ovmobilebench"
use_root: false
env_vars:
LD_LIBRARY_PATH: "/data/local/tmp/ovmobilebench/lib:$LD_LIBRARY_PATH"| Device | SoC | CPU Cores | Recommended Config |
|---|---|---|---|
| Pixel 6 | Google Tensor | 2x X1 + 2x A76 + 4x A55 | threads: 4-8 |
| Galaxy S21 | Snapdragon 888 | 1x X1 + 3x A78 + 4x A55 | threads: 4-8 |
| OnePlus 9 | Snapdragon 888 | 1x X1 + 3x A78 + 4x A55 | threads: 4-8 |
| Xiaomi 11 | Snapdragon 888 | 1x X1 + 3x A78 + 4x A55 | threads: 4-8 |
- Linux ARM device (Raspberry Pi, Jetson, etc.)
- SSH access to device
- Sufficient storage space
# On Raspberry Pi
sudo systemctl enable ssh
sudo systemctl start sshsudo apt-get install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh# On host machine
# Generate SSH key if needed
ssh-keygen -t rsa -b 4096
# Copy key to device
ssh-copy-id user@device.local
# Test connection
ssh user@device.local "echo 'Connection successful'"# Create working directory
ssh user@device.local "mkdir -p ~/ovmobilebench"
# Install dependencies
ssh user@device.local "sudo apt-get update && sudo apt-get install -y \
build-essential \
cmake \
git \
wget"
# Check system info
ssh user@device.local "uname -a && lscpu"OVMobileBench uses the paramiko library for SSH connections, providing secure and reliable communication with Linux devices. Paramiko supports both password and key-based authentication.
device:
type: "linux_ssh" # or kind: "linux_ssh"
host: "192.168.1.100" # Or hostname
port: 22
username: "ubuntu" # SSH username (or 'user' for compatibility)
password: "optional" # Optional if using key authentication
key_filename: "~/.ssh/id_rsa" # Path to SSH private key (or 'key_path')
push_dir: "/home/ubuntu/ovmobilebench"
env_vars:
LD_LIBRARY_PATH: "/home/ubuntu/ovmobilebench/lib:$LD_LIBRARY_PATH"Note: The SSH implementation uses paramiko for all operations including:
- Secure SSH connections
- SFTP file transfers
- Remote command execution
- Automatic retry with exponential backoff
| Device | SoC | CPU | RAM | Recommended Config |
|---|---|---|---|---|
| Raspberry Pi 4 | BCM2711 | 4x Cortex-A72 | 4-8GB | threads: 4 |
| Jetson Nano | Tegra X1 | 4x Cortex-A57 | 4GB | threads: 4 |
| Jetson Xavier NX | Xavier | 6x Carmel | 8GB | threads: 6 |
| Rock Pi 4 | RK3399 | 2x A72 + 4x A53 | 4GB | threads: 4-6 |
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0# Turn screen off
adb shell input keyevent 26
# Set screen timeout to maximum
adb shell settings put system screen_off_timeout 2147483647
# Reduce brightness
adb shell settings put system screen_brightness 0# Enable airplane mode (may require root)
adb shell settings put global airplane_mode_on 1
# Disable WiFi
adb shell svc wifi disable
# Disable mobile data
adb shell svc data disable# Stop unnecessary services
adb shell am force-stop com.android.chrome
adb shell am force-stop com.google.android.gms
# Clear RAM (requires root)
adb shell "echo 3 > /proc/sys/vm/drop_caches"# Check available governors
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# Set performance governor
sudo cpupower frequency-set -g performance
# Or manually for each core
for cpu in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
echo performance | sudo tee $cpu
done# Disable turbo boost (Intel)
echo 1 | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
# Set max frequency
sudo cpupower frequency-set -f max# Pin to big cores (device-specific)
# Example for Snapdragon 888 (cores 4-7 are big)
adb shell "taskset 0xF0 benchmark_app ..."# Increase memory limits (root)
adb shell "echo 2048 > /proc/sys/vm/min_free_kbytes"
adb shell "echo 0 > /proc/sys/vm/swappiness"# Monitor temperature
adb shell "cat /sys/class/thermal/thermal_zone0/temp"
# Check throttling status
adb shell dumpsys thermalservice# Check NUMA nodes
numactl --hardware
# Pin to specific node
numactl --cpunodebind=0 --membind=0 benchmark_app# Move IRQs away from benchmark cores
echo 1 | sudo tee /proc/irq/default_smp_affinity# Enable transparent huge pages
echo always | sudo tee /sys/kernel/mm/transparent_hugepage/enabled# List all connected devices
adb devices -l
# Run commands on specific device
adb -s R3CN30XXXX shell "command"device:
kind: "android"
serials:
- "R3CN30XXXX" # Pixel 6
- "1234567890" # Galaxy S21
- "ABCDEF1234" # OnePlus 9
push_dir: "/data/local/tmp/ovmobilebench"#!/bin/bash
# identify_devices.sh
for serial in $(adb devices | grep device$ | cut -f1); do
echo "Device: $serial"
adb -s $serial shell getprop ro.product.model
adb -s $serial shell getprop ro.product.cpu.abi
echo "---"
done# Use environment variables for different hosts
device:
kind: "linux_ssh"
host: "${TARGET_HOST}"
user: "${TARGET_USER}"
key_path: "~/.ssh/id_rsa"[arm_devices]
rpi4-1 ansible_host=192.168.1.101 ansible_user=pi
rpi4-2 ansible_host=192.168.1.102 ansible_user=pi
jetson-1 ansible_host=192.168.1.110 ansible_user=ubuntu# Restart ADB server
adb kill-server
adb start-server
# Check USB connection
lsusb | grep -i google # For Pixel devices
# Try different USB port/cable# Check SELinux status
adb shell getenforce
# Temporarily set permissive (root)
adb shell setenforce 0
# Use alternative directory
adb shell mkdir -p /sdcard/ovmobilebench# Check available space
adb shell df -h
# Clear cache
adb shell pm clear com.android.systemui
# Use external storage
adb shell mkdir -p /sdcard/Android/data/ovmobilebench# Check SSH service
sudo systemctl status ssh
# Check firewall
sudo ufw status
# Allow SSH
sudo ufw allow 22/tcp# Check key permissions
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
# Verify key
ssh-keygen -l -f ~/.ssh/id_rsa
# Test with password
ssh -o PreferredAuthentications=password user@host# Use compression
scp -C file user@host:/path
# Check network
ping -c 10 device.local
# Use rsync instead
rsync -avz --progress file user@host:/path#!/bin/bash
# monitor_android.sh
SERIAL=$1
while true; do
# Temperature
TEMP=$(adb -s $SERIAL shell cat /sys/class/thermal/thermal_zone0/temp)
echo "Temp: $((TEMP/1000))°C"
# Battery
BATTERY=$(adb -s $SERIAL shell dumpsys battery | grep level)
echo "Battery: $BATTERY"
# CPU frequency
FREQ=$(adb -s $SERIAL shell cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
echo "CPU Freq: $((FREQ/1000)) MHz"
sleep 5
done#!/bin/bash
# monitor_linux.sh
while true; do
# Temperature
sensors | grep "Core"
# CPU frequency
cpupower frequency-info | grep "current CPU"
# Memory
free -h | grep Mem
# Load average
uptime
sleep 5
done- Consistency: Use same device state for all benchmarks
- Isolation: Minimize background activity
- Thermal: Allow cooldown between runs
- Power: Use consistent charging state
- Documentation: Record device configuration
- Validation: Verify setup before benchmarking
- Automation: Script repetitive setup tasks