Skip to content

Instantly share code, notes, and snippets.

@ademar111190
Last active August 29, 2015 13:56
Show Gist options
  • Save ademar111190/8939743 to your computer and use it in GitHub Desktop.
Save ademar111190/8939743 to your computer and use it in GitHub Desktop.
Restart adb as root on linux

##Restart ADB as root a linux utilitie to android developers

##how to use

###dependencies

Your adb need be on PATH variable
You need sudo access

###compile it

gcc restartAdb.c -orestartAdb

###run it

./restartAdb

###use it ever

//edit your ~/.profile and add it:
export PATH=$PATH:/your/path/to/restartAdb/folder
//now you can use it in any folder calling restartAdb
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
int main() {
system("sudo adb kill-server");
system("sudo adb start-server");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment