Tuesday, October 10, 2017

terminal on real android device from PC


I want to run terminal on my device however the small screen is very inconvenient. I wondering if it is possible to run terminal on real android device from PC?



Answer



You can use Android Debug Bridge (ADB) shell to issue basic Linux commands on your phone, just like you would in a terminal emulator app. To install you'll need to do the following:



  1. On the phone go to Settings -> About phone, and tap on "Build number" seven times. This enabled Developer tools.

  2. Go back to the main Settings screen and you should now see Developer options under the "System" section.

  3. Go to Developer options, enable "Android debugging" option, and then tap OK on the verification prompt.

  4. On your PC download the Android SDK Tools from here. You can either download the whole SDK, or just the stuff necessary to connect to your phone, which is on the same page, under "Download for other platforms -> SDK Tools Only" section.


  5. Install the tools you just downloaded.

  6. Download and install the USB drivers for your phone (usually provided by the manufacturer.)

  7. Re-connect your phone to the PC with a USB cable.

  8. Open Command prompt (assuming Windows,) navigate to where you installed the SDK tools (e.g. "C:\android-sdk\platform-tools\") and type in the following: adb devices

  9. If all of the above was done successfully, a prompt should pop up asking you to allow connections from this computer. Accept the pairing request, and the prompt should show your phone's ID. If this doesn't happen - it usually means that the drivers aren't installed correctly.

  10. Back at Command prompt, type in adb shell and press Enter, and you should be connected to the phone's terminal.


This should get you started. ADB commands are listed on Google's site here. The shell provides some basic Linux commands like ls, cp, etc. Be aware that most file and device management commands will require root (i.e. elevated privileges,) which is a separate topic.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...