π² Control Android and iOS devices or Emulators/Simulators using terminal commands
π Take screeshots, change developer settings, gather app & device intel
βοΈ Manage mobile applications - install, restart, wipe data and much more
π Handle multiple devices effortlessly - select from list or target all connected devices
β³ Save your precious time - stop doing repetitive tasks manually
π Automatic update - get new features and fixes ASAP
π€ Pull request contribution is highly appreciated, see Issues section
βοΈ Love Mobile Toolkit? -> Hit the star button and bring me joy!
- Open terminal
- Clone this repository
git clone https://github.com/IntergalacticPenguin/mobile-toolkit.git
- Setup Android tools
- Download and install Android Studio or Android command line tools
- Add the absolute path to the platform-tools folder to PATH variable in .bash_profile
PATH=$PATH:/Users/dummyuser/Library/Android/sdk/platform-tools export PATH
- Allow USB debugging on your device, connect it and authorize your computer (click OK on device screen)
- Setup iOS tools
- Install latest Xcode and iOS command line tools using App Store
- Install Homebrew package manager
- Install usbmuxd, libimobiledevice and ideviceinstaller
brew install --HEAD usbmuxd && brew install --HEAD libimobiledevice && brew install --HEAD ideviceinstaller
- Mount developer image on your device -> connect iOS device to USB, authorize your computer (click "Trust" on device screen) and run Xcode
- (Optional) Use following commands in any directory in your terminal
- Edit your .bash_profile file (or .zshrc if you have zsh shell) in your home directory
nano ~/.bash_profile
- Add the path to the script folders to PATH variable in .bash_profile (or equivalent file) -> insert the following lines at the end of the file, make sure to replace "dummyuser" with your profile name and use proper path
PATH=$PATH:/Users/dummyuser/Repositories/Shell/mobile-toolkit/android
PATH=$PATH:/Users/dummyuser/Repositories/Shell/mobile-toolkit/ios
- Edit your .bash_profile file (or .zshrc if you have zsh shell) in your home directory
The scripts are primarily designed for macOS, but majority of functions should work on any Unix system.
ascreenshot
Save screenshot to ~/Desktopascreenshot -a
Take screenshot on all connected devices
arecord
Record screen- End recording using
ctrl + c
- Save screen video footage to ~/Desktop
arecord <custom-name>
Specify your own filename by passing it as argument
apaste "[email protected]" password1 "5005 1002 3332 1112" "2/19" 5004
apaste <text>
Insert text into currently focused fieldapaste "[email protected]" 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
Paste Lorem Ipsum paragraph
aurl "google.com"
Open link in web browser or corresponding application
abounds
Display layout bounds- Press ENTER to turn off
abounds -k
Toggle layout bounds visibility- App restart may be necessary on lower APIs
aanimationspeed
set slow animation speedaanimationspeed <speed>
set animation speed to <speed> times slower than default- Press ENTER to reset to default
afontscale <scale> -k
save changed settings
afontscale
set font scale to large (1.3x bigger than default)afontscale <scale>
set font scale to <scale> times larger than default- Press ENTER to reset to default
afontscale <scale> -k
save changed settings
- Start the default camera application
- Enable or disable wireless ADB connection
- Use ADB and toolkit without having USB cable attached
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
List foreground app information- Package name
- Version
- Last update
- minSdk and targetSdk
- Permissions
- Package name
- (Optional) Open application settings
aappinfo com.dummy.package.name.app
Target specific app by passing package name as argument
akill
Restart the foreground appakill com.dummy.package.name.app
Target specific app by passing package name as argument
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 some-app-file.apk
Install and run .apkainstall -a some-app-file.apk
Install and run .apk on all connected devices
auninstall
Uninstall third-party app, choose from the listauninstall com.dummy.package.name.app
pass package name as argumentauninstall -a
Uninstall all-third party packages- Skips some essential apps, edit IGNORED_PACKAGES in this script to customize the list to your needs
- Wipe internal storage (/mnt/sdcard directory) and delete all third-party apps
- Revoke ALL runtime permissions for ALL (even system) apps
agoogleplay "Dummy App"
Search for "Dummy App" on Google Playagoogleplay
Search for currently foreground app on Google Play
abuildproject
Build, install and run Android project located in current directoryabuildproject <relative-path>
Build, install and run Android project located in <relative-path>
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
Print system log outputalog -f <package-name>
Filter log by package name
acrash
Print log output containing application crashes onlyacrash <line-count>
Print <line-count> lines above and below crash log
- 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
- Print running background services
- Search for more information via Google
- Reboot the device
- Android emulator supports all listed scripts by default + extra actions listed below
aeimulator <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
iscreenshot
Save screenshot to ~/Desktopiscreenshot -a
Take screenshot on all connected devices
- Run QuickTime and open video source picker (so you can choose a device right away)
- You may have to allow some system permission, so the script can access the picker
Required: Install ffmpeg brew install ffmpeg
- Record screen (take as many screenshots per second as possible) to ~/Desktop
- End recording using
ctrl + c
- Compose .mp4 from screenshots and save it to ~/Desktop
- (Optional) Delete screenshots
- Specify your own filename by passing it as argument
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
Uninstall third-party app, choose from the listiuninstall com.dummy.package.name.app
pass bundle name as argumentiuninstall -a
Uninstall all third-party packages- Skips some essential apps, edit IGNORED_PACKAGES in this script to customize the list to your needs
ilog
Open console log output- Examine macOS or iOS system logs
- Gather crash logs from the device to ~/Desktop (be patient π )
- Choose whether to keep the logs on the device afterwards
- You can import these logs to Xcode to make them more readable via symbolication
- Open relevant project in Xcode
- Click on Window > Devices and Simulators > View Device Logs
- Drag the .crash file onto the log list
- Readable crash log should appear in the list
- Print device information
- (Optional) Search for the device on GSMArena
- Reboot the device
- 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)
You can read about my motivation in this blog post, if you made it this far in readme and you like my work, please be so kind and star this repository or leave some claps on Medium. Every appreciation empowers my motivation.