Automated Uber shuttle reservation bot for Xiaomi devices using Automate and Autox.js. All tools are free -- no paid apps required.
- Prerequisites
- Device Setup (MIUI / HyperOS)
- Uber App Requirements
- App Configuration
- Troubleshooting
- Project Structure
Install the following free apps before proceeding with device setup:
| App | Source | Purpose |
|---|---|---|
| Uber | Play Store | Shuttle booking target app (must be logged in) |
| Autox.js | GitHub Releases (download arm64-v8a APK) | JavaScript-based UI automation via Accessibility Service |
| Automate | Play Store (LlamaLab) | Flow-based task automation and scheduling |
All automation operates through the Android Accessibility Service -- no root access is required. All tools are free and open-source or free-tier.
Target device: Xiaomi 15T Pro running MIUI 15 / HyperOS
MIUI aggressively kills background apps to save battery. Every step below is critical to ensure Automate and Autox.js survive overnight and multi-day idle periods. Complete all steps for both Automate and Autox.js unless otherwise noted.
Note: MIUI updates may reset some of these settings. Re-verify all steps after any system update.
Prevents MIUI from restricting background activity for Automate and Autox.js. Setting "No Restrictions" also disables battery saver for the app, covering both whitelisting and battery saver requirements.
For Automate:
- Open Settings
- Go to Battery > Battery Saver > App Battery Saver
- Find Automate in the app list
- Select No Restrictions
For Autox.js:
- Open Settings
- Go to Battery > Battery Saver > App Battery Saver
- Find Autox.js in the app list
- Select No Restrictions
On HyperOS, the path may appear as Settings > Battery > More battery settings > App battery saver. Look for the equivalent "No Restrictions" option.
Ensures both apps launch automatically after device restart.
- Open Settings
- Go to Apps > Autostart
- Toggle ON for Automate
- Toggle ON for Autox.js
On HyperOS, this may be under Settings > Apps > Permissions > Autostart.
Prevents MIUI from force-stopping apps during periodic "clean up" sweeps.
- Open Settings
- Go to Apps > App Lock
- Add Automate to the locked apps list
- Add Autox.js to the locked apps list
App Lock ensures MIUI does not include these apps when it cleans up background processes.
Autox.js requires the Accessibility Service to read and interact with UI elements in the Uber app.
- Open Settings
- Go to Additional Settings > Accessibility > Installed Apps
- Find Autox.js
- Toggle ON
- Confirm the permission dialog
On HyperOS, the path may be Settings > Additional Settings > Accessibility > Downloaded apps > Autox.js.
Automate requires notification access to manage and deliver booking notifications.
- Open Settings
- Go to Notifications > Notification Access
- Find Automate
- Toggle ON
- Confirm the permission dialog
On HyperOS, the path may be Settings > Notifications > Advanced settings > Notification access.
- Uber must be installed and logged in before running any automation. The bot interacts with the Uber app through UI elements -- it does not use the Uber API or require separate authentication.
- Accessibility Service interaction model: Autox.js reads and clicks UI elements via the Android accessibility tree. This means:
- The Uber app must be in a normal (not crashed or logged-out) state
- No root access or special Uber permissions are needed
- All automation works through standard Accessibility Service APIs
- Coexistence with normal usage: The automation runs as a background service and does not hijack the foreground. You can use your phone normally while the bot is idle.
After completing device setup:
- Copy the contents of the
autojs/directory to/sdcard/Scripts/autojs/on your device - Open Autox.js and load the scripts from that directory
- Ensure the script service is running
The bot reads its configuration from /sdcard/Scripts/autojs/ubot-config.json. If this file is missing, the bot uses sensible defaults. To customize, create the file with your settings:
{
"workingDays": ["Sun", "Mon", "Tue", "Wed", "Thu"],
"goTime": "08:00",
"returnTime": "17:00",
"pickupStop": "",
"dropoffStop": ""
}- workingDays: Days of the week the shuttle runs (comma-separated abbreviations)
- goTime / returnTime: Departure and return times in HH:MM format
- pickupStop / dropoffStop: Your shuttle stop names (leave empty to use defaults)
Create the automation flows in Automate following the Automate Setup Guide. There are 4 flows to create:
- Evening Reminder -- Sun-Wed at 21:00
- Saturday Check-In -- Saturday at 10:00
- Wednesday Booking -- Wednesday at 09:50
- Ride Status Check -- Sun-Thu at 06:00 and 16:00
Verify all flows are started (shown with a green play icon).
The bot automatically creates and manages these files:
autojs/state.json-- Persistent state (booking status, retry counts). Created automatically on first run. If corrupted, the bot resets it and saves a backup asstate.json.bak.logs/-- Daily log files (booking-YYYY-MM-DD.log). Automatically rotated after 14 days.
Symptoms: Automate or Autox.js stops running after the screen turns off or after leaving the device idle overnight.
Fixes:
- Re-verify all whitelisting steps in Device Setup above
- Confirm App Lock is enabled for both apps (see App Lock)
- Last resort: Enable Developer Options and disable MIUI Optimization:
- Settings > Additional Settings > Developer Options > MIUI Optimization > toggle OFF
- Restart the device when prompted
- Warning: This is a system-wide change that affects all apps (permissions, notifications, etc.). Only use this if the steps above did not resolve the issue. It can be re-enabled the same way.
- Check that no third-party battery saver or cleaner app is killing background processes
Symptoms: The automation runs but no notification appears confirming the booking.
Fixes:
- Verify notification access is granted for Automate (see Notification Access)
- Check notification channel settings for Automate in Settings > Notifications > App notifications > Automate
- Ensure Do Not Disturb is either off or has exceptions for Automate
- Verify Automate has "Show notifications" enabled
Check Automate:
- Open Automate
- Verify flows are running (shown with a green play icon)
- If a flow is stopped, tap it and press the play button
Check Autox.js:
- Open Autox.js
- Verify the script service is running (shown in the status bar)
- If not running, tap the play button or restart the service
Check Accessibility Service:
- Open Settings > Additional Settings > Accessibility > Installed Apps
- Verify Autox.js shows as enabled
- If disabled, toggle it back on (MIUI may disable it after updates)
Automate and Autox.js should auto-launch on boot if Autostart is enabled (see Autostart).
If apps don't start after reboot:
- Verify Autostart is still enabled for both apps (Automate and Autox.js)
- Check that Automate has "Run on system startup" enabled in its settings
- Manually open both Automate and Autox.js once to re-initialize background services
- Re-verify Accessibility Service is enabled for Autox.js (it may get disabled after reboot on some MIUI versions)
UberBot/
├── autojs/ # Autox.js scripts (deployed to /sdcard/Scripts/autojs/)
│ ├── main.js # Main entry point (dispatcher)
│ ├── config.js # Configuration module
│ ├── booking.js # Booking flow orchestrator
│ ├── log.js # Logging module
│ ├── state.js # State management module
│ └── tests/ # Test files
├── automate/ # Automate setup guide
├── scripts/ # Utility scripts
├── docs/ # Project documentation
└── README.md # This file