Repository: IGPenguin/mobile-toolkit Branch: master Commit: 491c778f676e Files: 56 Total size: 94.1 KB Directory structure: gitextract_fh0eifjr/ ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── count_lines.yml │ └── shellcheck.yml ├── .gitignore ├── LICENCE.md ├── README.md ├── android/ │ ├── aanimationspeed │ ├── aappinfo │ ├── abounds │ ├── abuildproject │ ├── acamera │ ├── acheckdevice │ ├── acontrol │ ├── adarkmode │ ├── aemulator │ ├── aerase │ ├── afontscale │ ├── agoogleplay │ ├── ainstall │ ├── akill │ ├── alaunch │ ├── alog │ ├── aoptions │ ├── apaste │ ├── apermissionreset │ ├── apowerbutton │ ├── areboot │ ├── arecord │ ├── ascreenshot │ ├── aservices │ ├── atalkback │ ├── atestmonkey │ ├── atestmonkeykill │ ├── auninstall │ ├── aurl │ ├── awipe │ └── awireless ├── changelog.txt ├── common_tools ├── data/ │ └── .gitignore └── ios/ ├── icheckdevice ├── iconsole ├── iinstall ├── ikill ├── ilang ├── ilaunch ├── ilog ├── ioptions ├── iquicktime ├── ireboot ├── irecord ├── iscreenshot ├── isimulator └── iuninstall ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/CONTRIBUTING.md ================================================ ## 💬 Contributing If you consider contributing to this repository, please first discuss the desired changes via issue, email, or any other method ### 🕵️‍ Pull request requirements 1. Implement all functions thoroughly and remove any unused or non-working code 2. Format all terminal output in a similar way as the existing 3. Ensure every code change and usage variant is tested 4. Update the README.md and changelog.txt with details of changes to the commands ### ✏️ Right to make changes Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ ### 🐞 Whats wrong ~Describe requested functionality or existing bug~ ### 🌈 Desired state ~Describe desired code and functional changes~ ### 📏 Challenges ~Hint any special or complicated tasks~ ### 📂 Sources ~Recommend related code samples or documentation~ ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ## ⚠️ Progress checklist - [ ] 🏗 **Features fully completed** - [ ] 🔬 **Shellcheck issues resolved** - [ ] 🔨 **All changes tested** - [ ] 💬 **Terminal output satisfactory** - [ ] 👀 **Diff examined thoroughly** - [ ] 📝 **API changes included in `README.md`** - [ ] 📣 **Major changes listed in `changelog.txt`** ================================================ FILE: .github/workflows/count_lines.yml ================================================ name: Count lines on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Count lines of text in this repository run: git ls-files *[^.png] | xargs wc -l | grep total | awk '{print $1}' > count.txt - uses: pCYSl5EDgo/cat@master id: count with: path: count.txt - run: echo $TEXT env: TEXT: ${{ steps.count.outputs.text }} ================================================ FILE: .github/workflows/shellcheck.yml ================================================ name: 'Shellcheck' on: push jobs: shellcheck: name: Shellcheck runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Shellcheck uses: ludeeus/action-shellcheck@master env: SHELLCHECK_OPTS: -e SC1090 -e SC2207 -e SC2001 -e SC1091 # SC1090 - non-constant source # SC2207 - no arrays like this ($()) # SC2001 - replace sed with ${variable//search/replace} # SC1091 - common_tools was not specified as input (see shellcheck -x) ================================================ FILE: .gitignore ================================================ *DS_Store ios/go-ios ios/nohup.out ios/selfidentity.plist ================================================ FILE: LICENCE.md ================================================ MIT License Copyright (c) 2019 IntergalacticPenguin - Adam Svoboda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is urnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ![Header](/media/header_v2.png?raw=true)
## What is its purpose? 🛠 **Control Android & iOS devices:** Capture screen, manage apps, simulate input, examine system logs etc.
⚡️ **Speed++** Are you an app developer or a tester? Boost your effectivity, discover new tools!
## All features 📲 **Control Android and iOS devices** or Emulators/Simulators using terminal commands
🛠 **Take screeshots, change device settings**, gather app & device information
⚙️ **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
## Table of contents 🔩 Maybe you just want to skip to [Installation](#section-id-22)?

[🤖 Android Commands](#section-id-52) - [Capture screen](#section-id-54) - [📸 ascreenshot](#section-id-56) - [🎥 arecord](#section-id-60) - [Control device](#section-id-66) - [✏️ apaste](#section-id-68) - [🌐 aurl](#section-id-78) - [🏴 adarkmode](#section-id-82) - [🔊 atalkback](#section-id-85) - [📐 abounds](#section-id-88) - [🚗 aanimationspeed](#section-id-92) - [🔠 afontscale](#section-id-96) - [🎹 acontrol](#section-id-100) - [📷 acamera](#section-id-104) - [⚡️ awireless](#section-id-107) - [👋 apowerbutton](#section-id-108) - [Manage packages](#section-id-111) - [🚀 alaunch](#section-id-113) - [🕵️ aappinfo](#section-id-118) - [🔪 akill](#section-id-128) - [🧽 aerase](#section-id-132) - [🚚 ainstall](#section-id-136) - [🗑 auninstall](#section-id-140) - [🔥 awipe](#section-id-146) - [🐁 apermissionreset](#section-id-149) - [🛍 agoogleplay](#section-id-153) - [🏭 abuildproject](#section-id-157) - [Manage device](#section-id-161) - [⚙️ aoptions](#section-id-163) - [📜 alog](#section-id-176) - [📋 acheckdevice](#section-id-180) - [😎 aservices](#section-id-192) - [♻ areboot](#section-id-196) - [📱 aemulator](#section-id-199) - [🐒 atestmonkey](#section-id-215) [🍎 iOS Commands](#section-id-233)
- [Capture screen](#section-id-235) - [📸 iscreenshot](#section-id-237) - [🎥 irecord](#section-id-241) - [📹 iquicktime](#section-id-250) - [Manage applications](#section-id-255) - [🚚 iinstall](#section-id-256) - [🗑 iuninstall](#section-id-260) - [🚀 ilaunch](#section-id-266) - [🔪 ikill](#section-id-271) - [Manage device](#section-id-276) - [⚙️ ioptions](#section-id-278) - [💬 ilang](#section-id-281) - [📜 ilog](#section-id-285) - [📋 icheckdevice](#section-id-288) - [♻ ireboot](#section-id-292) - [📱 isimulator](#section-id-295) - [🖥 iconsole](#section-id-309) 💭 Do you want to share [Feedback or Contribute](#section-id-312)?
# 💻 Installation
Click here to reveal step by step guide ↓ _Note: This tool targets macOS for compatibility, but most interactions should work on any Unix system._
1. **Open terminal** 2. **Clone this repository** `git clone https://github.com/IntergalacticPenguin/mobile-toolkit.git` 3. **Setup Android tools** * **[Download](https://developer.android.com/studio/ "Android Studio") 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** * **[Allow USB debugging](https://developer.android.com/studio/debug/dev-options) on your device, connect it and authorize your computer** (click OK on the device screen) 4. **Setup iOS tools** * **Install latest Xcode and iOS command line tools** using [App Store](https://apps.apple.com/cz/app/xcode/id497799835?mt=12) * **Install [Homebrew](https://brew.sh/ "Homberew") 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](https://stedolan.github.io/jq/) and [go-ios](https://github.com/danielpaulus/go-ios "go-ios")) 5. **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**
`PATH=$PATH:/Users/dummyuser/mobile-toolkit/android`
`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**
# 🤖 Android Commands
## Capture screen
### 📸 ascreenshot * `ascreenshot` Save screenshot to ~/Desktop * `ascreenshot -a` Take screenshot on all connected devices
### 🎥 arecord 1. `arecord` Record screen 2. End recording using `ctrl + c` 3. Save screen video footage to ~/Desktop 4. Records audio by default on devices running Android 12 and up (when using Scrcpy version 2.0.0 or higher) * `arecord ` Specify your own filename by passing it as argument * `arecord -l` Use legacy `-l` option to record using ADB instead of Scrcpy
## Control device
### ✏️ apaste `apaste "john.doe@fakemail.com" password1 "5005 1002 3332 1112" "2/19" 5004` * `apaste ` Insert text into currently focused field * `apaste "john.doe@fakemail.com" password1 ` Every additional argument will be inserted into subsequent field * `apaste "This is sample multi-word text."` use "" to insert multi-word text into one field * `apaste -l` Insert "Lorem Ipsum paragraph" * `apaste -a ` Insert any text input (options displayed above) on all connected devices * `apaste -a -l` Insert "Lorem Ipsum paragraph" on all connected devices
### 🌐 aurl * `aurl "google.com"` Open link in web browser or corresponding application * `aurl -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 default * `aanimationspeed ` set animation speed multiplier
### 🔠 afontscale * `afontscale` set large font scale (1.3x bigger than default) or restore default * `afontscale ` set font scale multiplier
### 🎹 acontrol * `acontrol` start [scrcpy](https://github.com/Genymobile/scrcpy "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
### 👋 apowerbutton * Lock/Unlock the device (send Power button key event) * Useful to unlock the device after the screen is locked automatically
## Manage packages
### 🚀 alaunch * `alaunch` List third-party apps and choose one to run it * `alaunch -s` List all available apps (including os pre-installed) and choose one to run it * `alaunch 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 app * `akill 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 it * `aerase com.dummy.package.name.app` Target specific app by passing package name as argument
### 🚚 ainstall * `ainstall some-app-file.apk` Install and run .apk * `ainstall -a some-app-file.apk` Install and run .apk on all connected devices
### 🗑 auninstall * `auninstall` Uninstall third-party app, choose from the list * `auninstall com.dummy.package.name.app` pass package name as argument * `auninstall -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 Play * `agoogleplay` Search for currently foreground app on Google Play
### 🏭 abuildproject * `abuildproject` Build, install and run Android project located in current directory * `abuildproject ` Build, install and run Android project located in \
## Manage device
### ⚙️ 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 options * `aoptions 1,2,3... | dev | locale | date | wifi | storage | power` Use a preset, choose one
### 📜 alog * `alog` Print system log output * `alog -f ` 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](https://www.gsmarena.com/ "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` or `open -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