Awesome
<div id='section-id-2'/>What is its purpose?
🛠 Control Android & iOS devices: Capture screen, manage apps, simulate input, examine system logs etc.<br>
⚡️ Speed++ Are you an app developer or a tester? Boost your effectivity, discover new tools!
<div id='section-id-8'/>All features
📲 Control Android and iOS devices or Emulators/Simulators using terminal commands<br>
🛠 Take screeshots, change device settings, gather app & device information<br>
⚙️ Manage mobile applications - install, restart, wipe data and much more<br>
📋 Handle multiple devices effortlessly - select from list or target all connected devices<br>
⏳ Save your precious time - stop doing repetitive tasks manually<br>
🔄 Automatic update - get new features and fixes ASAP<br>
Table of contents
🔩 Maybe you just want to skip to Installation?<br> <br> <bold>🤖 Android Commands</bold>
<strong>🍎 iOS Commands</strong><br>
💭 Do you want to share Feedback or Contribute?
<div id='section-id-22'/>💻 Installation
<details> <summary>Click here to reveal step by step guide ↓</summary>Note: This tool targets macOS for compatibility, but most interactions should work on any Unix system. <br>
- Open terminal
- Clone this repository
git clone https://github.com/IntergalacticPenguin/mobile-toolkit.git
- Setup Android tools
- Download and install Android Studio and Android command line tools (using Android Studio SDK manager)
- Edit .zshrc (or .bash_profile if you have bash shell)
open -e ~/.zshrc
- Insert this line at the end
PATH=$PATH:/Users/dummyuser/Library/Android/sdk/platform-tools export PATH
- Don't forget to replace "dummyuser" with your account username
- Use full path to the "platform-tools" directory
- Insert this line at the end
- Allow USB debugging on your device, connect it and authorize your computer (click OK on the device screen)
- Setup iOS tools
- Install latest Xcode and iOS command line tools using App Store
- Install Homebrew package manager
- Run Xcode, connect iOS device to USB and authorize your computer (click "Trust" on the device screen)
- Run any script i.e.
iscreenshot
, installation of all required tools will be initiated automatically (jq and go-ios)
- Add Mobile Toolkit to $PATH, it is mandatory for iOS scripts and it will let you run scripts in any directory
- Edit .zshrc (or .bash_profile if you have bash shell)
open -e ~/.zshrc
- Insert the following lines at the end <br>
PATH=$PATH:/Users/dummyuser/mobile-toolkit/android
<br>PATH=$PATH:/Users/dummyuser/mobile-toolkit/ios
- Don't forget to replace "dummyuser" with your account username
- Use full path to the "mobile-toolkit" directory (where you cloned this repository)
- Add
export PATH
to the end of the file
- Insert the following lines at the end <br>
- Edit .zshrc (or .bash_profile if you have bash shell)
🤖 Android Commands
<div id='section-id-54'/>Capture screen
<div id='section-id-56'/>📸 ascreenshot
ascreenshot
Save screenshot to ~/Desktopascreenshot -a
Take screenshot on all connected devices
🎥 arecord
arecord
Record screen- End recording using
ctrl + c
- Save screen video footage to ~/Desktop
- Records audio by default on devices running Android 12 and up (when using Scrcpy version 2.0.0 or higher)
arecord <custom-name>
Specify your own filename by passing it as argumentarecord -l
Use legacy-l
option to record using ADB instead of Scrcpy
Control device
<div id='section-id-68'/>✏️ apaste
apaste "john.doe@fakemail.com" password1 "5005 1002 3332 1112" "2/19" 5004
apaste <text>
Insert text into currently focused fieldapaste "john.doe@fakemail.com" password1
Every additional argument will be inserted into subsequent fieldapaste "This is sample multi-word text."
use "" to insert multi-word text into one fieldapaste -l
Insert "Lorem Ipsum paragraph"apaste -a <input-text>
Insert any text input (options displayed above) on all connected devicesapaste -a -l
Insert "Lorem Ipsum paragraph" on all connected devices
🌐 aurl
aurl "google.com"
Open link in web browser or corresponding applicationaurl -a "google.com"
Open link in web browser or corresponding application on all connected devices
🏴 adarkmode
adarkmode
Toggle system dark mode
🔊 atalkback
atalkback
Toggle TalkBack screen reader accessiblity option
📐 abounds
abounds
Toggle UI layout bounds- App restart may be necessary on lower APIs
🚗 aanimationspeed
aanimationspeed
set slower animation speed or restore defaultaanimationspeed <speed>
set animation speed multiplier
🔠 afontscale
afontscale
set large font scale (1.3x bigger than default) or restore defaultafontscale <scale>
set font scale multiplier
🎹 acontrol
acontrol
start scrcpy session- Provides realtime device screen mirroring and keyboard+mouse control
📷 acamera
- Start the default camera application
⚡️ awireless
- Enable or disable wireless ADB connection
- Use ADB and toolkit without having USB cable attached
Manage packages
<div id='section-id-113'/>🚀 alaunch
alaunch
List third-party apps and choose one to run italaunch -s
List all available apps (including os pre-installed) and choose one to run italaunch com.dummy.package.name.app
Run app by package name
🕵️ aappinfo
aappinfo
List foreground app information- Package name
- Version
- Last update
- minSdk and targetSdk
- Permissions
- (Optional) Open application settings
aappinfo com.dummy.package.name.app
Target specific app by passing package name as argument
🔪 akill
akill
Restart the foreground appakill com.dummy.package.name.app
Target specific app by passing package name as argument
🧽 aerase
aerase
Delete all local data of the foreground app and restart itaerase com.dummy.package.name.app
Target specific app by passing package name as argument
🚚 ainstall
ainstall some-app-file.apk
Install and run .apkainstall -a some-app-file.apk
Install and run .apk on all connected devices
🗑 auninstall
auninstall
Uninstall third-party app, choose from the listauninstall com.dummy.package.name.app
pass package name as argumentauninstall -w
Uninstall all-third party packages- Skips some essential apps, edit IGNORED_PACKAGES in this script to customize the list to your needs
🔥 awipe
- Wipe internal storage and delete all third-party apps
🐁 apermissionreset
- Revoke ALL GRANTED runtime permissions for ALL apps
- You'll have to handle permission requests upon opening almost any app
🛍 agoogleplay
agoogleplay "Dummy App"
Search for "Dummy App" on Google Playagoogleplay
Search for currently foreground app on Google Play
🏭 abuildproject
abuildproject
Build, install and run Android project located in current directoryabuildproject <relative-path>
Build, install and run Android project located in <relative-path>
Manage device
<div id='section-id-163'/>⚙️ aoptions
aoptions
Open system settings on a specific activity- You can choose from quick presets
- Developer settings
- Locale settings
- Date & time
- Wifi settings
- Storage management
- Power usage
- Root settings activity
aoptions A
Choose from exhaustive list of all available optionsaoptions 1,2,3... | dev | locale | date | wifi | storage | power
Use a preset, choose one
📜 alog
alog
Print system log outputalog -f <package-name>
Filter log by package name
📋 acheckdevice
- Print genereal device information
- Perform basic safety-checks and toggle "testing firendly" settings
- 10 minutes screen timeout
- Highest brightness
- Automatic date
- Disabled notification sounds
- Internet connectivity and WIFI name
- Font scale
- enUS locale
- (Optional) Search for the device on GSMArena
😎 aservices
- Print running background services
- Search for more information via Google
♻ areboot
- Reboot the device
📱 aemulator
Required: Make terminal use Android Studio Java
-
Edit .bash_profile (or .zshrc if you have zsh shell)
open -e ~/.bash_profile
oropen -e ~/.zshrc
-
Add the following line at the end of the file
export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'
-
Android emulator supports all listed scripts by default + extra actions listed below
-
aemulator <option>
Handle various Android emulator activitesstart
- choose and launch installed emulatorgprs | edge | 3g
- simulate network latency, choose onecall <number>
- receive fake callsms <number> <text>
- receive fake smsgps <lat> <long>
- set manual GPS locationbattery <0-100>
- set battery leveltelnet <command>
- call command via telnet- example commands
event | redir | sensor | physics | finger | rotate | fold | unfold...
see Android emulator documentation for more information
- example commands
🐒 atestmonkey
atestmonkey
Default test with random seed and 15000 input eventsatestmonkey <event-count>
Test with random seed and custom input event countatestmonkey <event-count> <seed>
Test with custom seed and custom event count- Perform automated stress test using Application Excersciser Monkey
- You can end test prematurely using ctrl^c or
atestmonkeykill
in case something goes wrong - App under test needs to be pinned to fullscreen mode to prevent unwanted interactions elsewhere
- Screen pinning button location is directly tied to OS version and device manufacturer skin.
- It may be tricky to turn on, see examples below:<br><br>
- <details> <summary>Google Nexus 5 (Android 6)</summary> <br><em>You need to bring the app window to foreground, the button is located in bottom right corner.</em><br><br> <img src="/media/Pinning_Nexus_v4.png" width="420"></details>
- <details> <summary>Google Pixel 3 (Android 11)</summary> <br><em>You need to click on the app icon, the button is located in popup menu.</em><br><br> <img src="/media/Pinning_Pixel_v2.png" width="420"></details>
🍎 iOS Commands
<div id='section-id-235'/>Capture screen
<div id='section-id-237'/>📸 iscreenshot
iscreenshot
Save screenshot to ~/Desktopiscreenshot -a
Take screenshot on all connected devices
🎥 irecord
Required: Install videosnap -> download and install videosnap-0.0.8.pkg
<br>
Required: Install ffmpeg brew install ffmpeg
irecord
Record screen- End recording using
ctrl + c
- Video footage is saved to ~/Desktop
- File is compressed using ffmpeg
📹 iquicktime
- Run QuickTime and open video source picker (so you can choose a device right away)
- You may have to allow security system permission, so the script can access QuickTime application
- This is a fallback script for
irecord
on M1 macs as it is currently not working
Manage applications
<div id='section-id-256'/>🚚 iinstall
iinstall some-app-file.ipa
Install .ipa (make sure to use properly signed build)iinstall -a some-app-file.ipa
Install .ipa to all connected devices
🗑 iuninstall
iuninstall
Uninstall third-party app, choose from the listiuninstall com.dummy.package.name.app
pass bundle name as argumentiuninstall -w
Uninstall all third-party packages- Skips some essential apps, edit IGNORED_PACKAGES in this script to customize the list to your needs
🚀 ilaunch
ilaunch
List third-party apps and choose one to run itilaunch -s
List os pre-installed apps and choose one to run itilaunch com.dummy.bundle.id.app
Run app by bundle id
🔪 ikill
ikill
List third-party apps and choose one to restartikill -s
List os pre-installed apps and choose one to restartikill com.dummy.bundle.id.app
Target specific app by passing bundle id as argument
Manage device
<div id='section-id-278'/>⚙️ ioptions
ioptions
Open system settings application
💬 ilang
ilang <lang>
Change the device language to different one, according to ISO-639 (i.e. "cs")ilang
Change the device language to different one, choose from a list of all supported
📜 ilog
ilog
Print system log output
📋 icheckdevice
- Print device information
- (Optional) Search for the device on GSMArena
♻ ireboot
- Reboot the device
📱 isimulator
- Simulator has limited functionality (no camera, biometrics, Appstore...), but offers some extra options, unavailable on physical iOS devices
isimulator <option>
Handle various simulator related activitesstart
- choose and launch installed simulatorscreenshot
- save screenshot to ~/Desktoprecord
- save screen recording to ~/Desktop (full resolution and frame rate, without QuickTime hassle)paste <text>
- insert text into pasteboardimport <file>
- import image or video to simulator gallery applog
- print simulator logurl <url>
- open link in web browser or corresponding applicationwipe
- wipe all simulator databattery <0-100>
- set battery level displayed in status bar (no functional impact)time <hh:mm>
- set time displayed in status bar (no functional impact)
🖥 iconsole
iconsole
Examine iOS or macOS system logs using Console application
<strong>Feedback & Contribution</strong><br>
<sup>⁉️ Submit an issue to report any bugs, request a feature or ask questions.</sup><br> <sup>🤝 Pull requests are highly appreciated, see the issue board.</sup><br> <sup>💬 Also <strong>visit my NoMo</strong> project and leave a star.</sup><br> <sup>🔗 Find me on LinkedIn or Twitter.</sup><br>