From 44889d6f12133332500f6dc6217e1b1af364e464 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 11 Feb 2021 01:03:41 +0100 Subject: [PATCH] Add Guides --- Guides/CreatingALogcat.md | 56 ++++++++++++++++++++++ Guides/README.md | 9 ++++ Guides/SettingUpAdb.md | 99 +++++++++++++++++++++++++++++++++++++++ README.md | 2 + 4 files changed, 166 insertions(+) create mode 100644 Guides/CreatingALogcat.md create mode 100644 Guides/README.md create mode 100644 Guides/SettingUpAdb.md diff --git a/Guides/CreatingALogcat.md b/Guides/CreatingALogcat.md new file mode 100644 index 0000000..dcfb81b --- /dev/null +++ b/Guides/CreatingALogcat.md @@ -0,0 +1,56 @@ +# Creating A Logcat + +In this guide you will learn how to create a logcat to help app developers fix bugs + +--- + +## About Logcat + +Logcat is a command line tool that dumps Android system logs, including stuff like errors or warnings. + +These logs are very important to figure out what's going wrong! + +--- + +## Prerequisites + +### You will need + +- EITHER a PC with adb set up - A guide to do this can be found [here](./SettingUpAdb.md) +- OR a rooted phone + +--- + +## Creating a logcat + +There are two ways to create a logcat. Either via a pc and adb or via a terminal on your Phone, but this requires root. + +You can technically create a logcat with only your phone and no root, but this will only include limited info so it is not very useful! + +### Creating a logcat using adb on your PC + +- Run the following adb command. Unless you added adb to PATH, add a `.\` before the command. Having issues? Check the [Guide](./SettingUpAdb.md#Getting%20started%20using%20adb) + +```bash +adb shell logcat -c +adb shell logcat *:W > logcat.txt +``` + +- If this prints nothing and just freezes your terminal, perfect! That means it's working +- Now just do whatever is needed to cause the issue on your phone +- Once that is done, simply press CTRL+C or close the terminal to stop the logcat +- Your logcat can be found in the adb folder as logcat.txt + +### Creating a logcat using a rooted Android + +- First you need a Terminal. I recommend [Termux](https://play.google.com/store/apps/details?id=com.termux) +- Open it up and run the following command + +```bash +su -c "logcat -c && logcat *:W > /sdcard/logcat.txt" +``` + +- Grant root if prompted +- Now just do whatever is needed to cause the issue on your phone +- Once that is done, simply press CTRL+C or close the terminal to stop the logcat +- Your logcat can be found at /sdcard/logcat.txt which is the root of your file system where there's also stuff like your Download folder diff --git a/Guides/README.md b/Guides/README.md new file mode 100644 index 0000000..cb9d35a --- /dev/null +++ b/Guides/README.md @@ -0,0 +1,9 @@ +# Vanced Guides + +This folder contains all sorts of guides which might come in handy when dealing with Vanced or Android + +Just search through the files and open the one you need and you'll be greeted with a similar interface to the one you're reading right now + +## Contributors + +- [Vendicated](https://github.com/Vendicated) \ No newline at end of file diff --git a/Guides/SettingUpAdb.md b/Guides/SettingUpAdb.md new file mode 100644 index 0000000..363f47d --- /dev/null +++ b/Guides/SettingUpAdb.md @@ -0,0 +1,99 @@ +# Setting Up adb + +In this guide you will learn how to set up adb + +--- + +## About adb + +adb (Android Debug Bridge) is a command line tool that lets you communicate with your Android device from your PC. + +It has a bunch of useful features like installing/uninstalling apps, collecting system logs from your phone and debugging apps. + +It is an official Android sdk tool developed by Google, so it is completely safe to download and use! + +--- + +## Prerequisites + +### You will need + +- PC (Windows/Mac/Linux) +- USB cable to connect your phone to your PC +- IQ higher than 70 + +### Enabling USB Debugging on your phone + +In order to debug your phone with adb you first have to allow it. To do so, simply do the following steps on your phone: + +- Enable Developer Options. You can do so by going to `Settings > About Phone` and tapping Build Number 7 times +- Now go to `Settings > System > Developer options` and enable USB Debugging + +--- + +## Installing adb + +Now on your PC: + +- [Download adb](https://developer.android.com/studio/releases/platform-tools). Save it to wherever you want, it doesn't matter! +- Go to the folder you downloaded it to and extract the zip + +Congratulations! You're all set and ready to use adb! + +--- + +## Getting started using adb + +### Open the adb folder in a terminal + +- EITHER right click the folder and click `Open in Powershell / Open command prompt here / whatever` +- OR open a terminal manually and change directory to the adb folder with `cd PathToFullFolder` like `cd C:\Users\Ven\Downloads\adb` or `cd /home/ven/Downloads/adb` + +### Now you can execute adb commands via: + +- Windows: `.\adb myCommand` +- Linux: `./adb myCommand` + +Make sure your phone is connected to your PC and unlocked! + +--- + +## Let's test it! + +- Unlock your phone and connect it to your PC +- Run `.\adb devices` or `./adb devices` depending on your Os +- If everything is okay, you should now get a popup on your Phone whether you want to allow USB Debugging. Select yes +- Your Terminal should print something like + +```bash +List of devices attached +576OPB01 device +``` + +## Advanced - Adding adb to path for easier access + +path is a variable that exists on all operating systems. It tells your terminal where to look for programs so you don't have to be in that program's directory all the time. + +By adding adb to your path you can execute it from anywhere by simply typing `adb`. Doing so is very simple actually! + +### Adding adb to your path on Windows + +- Open the app search bar +- Search for env and choose `Edit the system environment variables` +- Click the Environment Variables button +- Under System Variables in the second half find PATH and click on edit +- Click New and paste the full path to the adb folder + +Next time you start a terminal you can just run `adb` and it will know where to look! + +### Adding adb to your path on Linux or Mac + +- Open a terminal +- Find out which shell you're using via `echo $SHELL` +- Run the appropriate command for your shell: + - zsh -> `echo "export PATH=/FULL/PATH/TO/ADB/FOLDER:$PATH" >> ~/.zshrc` + - bash -> `echo "export PATH=/FULL/PATH/TO/ADB/FOLDER:$PATH" >> ~/.bash_profile` +- Make sure you replace `/FULL/PATH/TO/ADB/FOLDER` with the actual path +- Example with my setup: `echo "export PATH=/home/ven/Downloads/adb:$PATH" >> ~/.zshrc` + +Next time you start a terminal you can just run `adb` and it will know where to look! \ No newline at end of file diff --git a/README.md b/README.md index ee86db6..b326077 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ ___ Useful guides like how to set up adb or how to create a logcat can be found [here](./Guides) +___ + ## Contributors - [gghhkm](https://github.com/gghhkm)