Terminal & Git on Android Mobile - android

This is not a duplicate question as my previous question is deleted.
I use terminal to run my Python and MongoDB codes and willing to use Git to do push/pull my codes into a remote repository. Just wanted to know if I can install a real working terminal in my Android Lolly Pop Phone which will allow me to install Git using...
$ sudo apt-get install git
Type command. If it is not possible then can anyone tell me whether I can use Git on my Android phone via terminal in any way?

You can use termux on android.
Follow the procedures:
$ apt update
$ apt upgrade
$ pkg install git
$ git clone <repository address >
To set up storage:
$ termux-setup-storage

You'd be best off just using one of the several apps on the market, SGit was the first that came up for me in a search.
I don't expect you'd have much luck trying to use git directly in a terminal emulator.

Related

how can I install java runtime on Android device?

I need to install some packages and Linux programs on my android devices. for example I want to use something similar YUM or get-apt command (I know these are Linux Commands) through windows powershell connected to my android device. but it does not recognize these commands. even ADB does not work, e.g. adb update -y is unknown command. How can i do this, is it possible. if the android kernel is linux so I guess there must be a way. I checked this but didnt help me:
Is it possible to install the JDK on an android device?
Thanks
EDITED: I used the link below , thanks to my friend for good answer. this is the command i used :
pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava
BUT when i run java command it says "Killed". No Idea!
Try Termux, a linux terminal emulator for android.A minimal base system is installed automatically - additional packages are available using the APT package manager. You can use following commands to install java8.
pkg install git
git clone https://github.com/MasterDevX/Termux-Java.git
cd Termux-Java
chmod +x installjava
bash installjava
When installed, run java -version to check, if it's correcty installed.
After that you can run java using Java command.
$ apt update && apt upgrade
$ apt install openjdk-17
First of all install termux.
Then run following commands :
$ pkg update -y && pkg upgrade -y
$ termux-setup-storage
And give the storage permission.
After that download these 2 files.
JDK-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
JRE-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
Remember the filenames, and the folder where you downloaded the files.
Go back to termux and run :
$ cd /sdcard/<folder name>
Replace foldername with your download folder.
$ mv file1 file2 $HOME
Replace file1 and file2 with actual filenames.
Alternative :
If you don’t want to download and move files manually you can use this commands (not recommended) :
$ pkg install wget -y
$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
It will download files within your termux home directory.
Finally run,
$ apt-get install -y ./openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
$ apt-get install -y ./openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
And You're done.
Try typing java or javac.
If you don’t see an Error you're good to go.
See Source
First, you need to install termux from their f droid link. Their playstore version is not updated. You can find the fdroid link from their github repository.
run the following command:
apt update
apt search openjdk
If you find a version of openjdk available, for example : presently openjdk-17 is available
install it using command:
apt install package-name
example:
apt install openjdk-17
follow the prompts and java will be installed in your termux.
Download java is possible
Check this github link
Termux java https://github.com/EagleComrade/Termux-java.git
It provides direct installtion of java from termux-source
Installtion from unwanted sources are not really trusted
So this tool is realy great
Do the following for install java without errors.
pkg install git
git clone https://github.com/EagleComrade/Termux-java.git
cd Termux-java
chmod +x install.sh
./install.sh
Java is installed .......
Install termux and run these commands
pkg update
pkg install openjdk-17
java --version
Install ubuntu on termux from anlinux... Then use
$ apt install default-jdk
Job done!

E:The repository 'http://apt.postgresql.org/pub/repos/apt tessa-pgdg Release' does not have a Release file

I have installed android studio on my linux mint 19.1 and after installation of it I restarted my PC. After restarting I couldn't see wi-fi sign in my machine.
Enable wifi option is not showing. I opened driver manager and I got the above error. I have already tried sudo apt-get update and sudo apt-get upgrade. I also restarted my machine several times.
I think this error appeared since the PostgreSQL repo doesn't have a release for "tessa".
Two solutions:
Edit the "/etc/apt/sources.list.d/pgdg.list" file (or another list file contains "http://apt.postgresql.org/pub/repos/apt tessa-pgdg Release") and change "tessa" to one of the version name supported by PostgreSQL (here is the list: https://apt.postgresql.org/pub/repos/apt/dists/).
Simply delete "/etc/apt/sources.list.d/pgdg.list" or remove the line "http://apt.postgresql.org/pub/repos/apt tessa-pgdg Release" in other file if you are not using PostgreSQL.
Here $(lsb_release -cs) returns terra and this doesn't work in many distributions. Use bionic instead, it should work
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
And then finally install pgadmin:
sudo apt install pgadmin4
Enjoy!
make
/etc/apt
make
sources.list.d
make
rm pgdg.list
make
sudo apt-get update && apt-get upgrade

git is unrecongised even I have installed it on my machine

In this tutorial they said:
To Clone volley you need to install Git GUI Client from (
http://git-scm.com/download ), I have installed Git GUI Client on my
windows machine After Installing Set the environment variable . After
Installing Git type the following below command line in your command
prompt.
git clone https://android.googlesource.com/platform/frameworks/volley
I have installed the gui git , and when I run the command I get git is unreconginised.
if I go to gui and and push to https://android.googlesource.com/platform/frameworks/volley they asked for username and password.
all I want is to clone volley and start using in my app. how to do that ?
Installing the git GUI vs installing git on the command line are different things.
When you download git, it should come with an application called git bash that looks like this
For Windows, you have to open this application which will come out with a terminal window of its own where you can perform git commands.
Keep in mind it has some basic things similar for navigation like in Linux (you can still use cd to navigate and wherever you do git clone, it will make the repo in that folder.
If you want to run git commands from command prompt, you need to check the option while installing i.e.
You can check if it's working on Command Prompt by typing git and you should see options come up.

Having problems compiling ffmpeg for Android

I'm trying to compile ffmpeg for Android using this guy script (https://github.com/guardianproject/android-ffmpeg) because it looked like the simplest and the whole NDK is really not my area of expertise.
So let's see what I've done so far:
Downloaded and installed a fresh Ubuntu 12.04 LTS from: http://www.ubuntu.com/download/desktop in a VirtualBox. (had some little problems with video but a few updates later in the terminal ubuntu is up and running)
installed the Android SDk and downloded/unzipped the NDK into /Documents/ndk
I used those commands to install the compiler:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ gcc -v
$ make -v
then sudo install git (or something like that to install git)
then git clone https://github.com/guardianproject/android-ffmpeg.git
then copied from the guys page building section
cd android-ffmpeg
git submodule init
git submodule update
NDK_BASE=/path/to/android-ndk ./configure_make_everything.sh
it mostly goes well until it says:
arm-linux-androideabi-gcc is unable to create an executable file C
compiler test failed
If you think configure made a mistake,.. blaah blahh blaah
I'm not sure what it means or where to go from here.
from this I did some chmod 777 on the folders to make sure stuff can be execute.
also from this I tried his script but without any luck.
help?
decompose what the script 'config_make_everything' is doing.. and run one step at a time...
https://github.com/guardianproject/android-ffmpeg/blob/master/configure_make_everything.sh
each step will create a file like 'config.log' where you can go to the tail and find more details about what went wrong finding the compiler.
When u start using the NDK, IMO, invest a bit of learn curve time going thru its ./doc directory and making sure that you have it integrated correctly. With NDK install, there are some samples. Build a few from CLI just to make sure that the ENV is correct and that the install is good, and that u have at least some idea of the build as a repeatable process. That will prove that you can do good 'cross compiles' with the build tools. Then you can return to guardian.ffmpeg stuff.
IMO - there is alot going on with an NDK build of this project and getting it all to build without understanding any of the underlying configuration / build stack would require lots of luck.

repo: command not found?

I am new to git and repo. I am in window 7 so I use cygwin. I have installed git from cygwin setup. After that I try to repo with the following command in cygwin.
$ repo init-u git://android.git.kernel.org/platform/manifest.git
I get an error like these:
bash: repo: command not found
I think I need to setup cygwin for repo. What do I need next to get repo?
Case 1: Not installed google repo yet?
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Use the following checksums when required:
For version 1.25 it is
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
For version 1.26, it is 0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b
Case 2: Already have google repo Installed, still wondering what went wrong ?
Add
PATH=~/bin:$PATH to the end of file ~/.bashrc
and then run
source ~/.bashrc
You still need to install repo. repo is a third party tool built on top of git. See:
http://source.android.com/source/downloading.html
for how to install
I have the same problem and I have to do:
$ PATH=~/bin:$PATH every time I repo sync but at least it works.
add line
export PATH=~/bin:$PATH in file ~/.bashrc
edit .bash_profile and uncomment these fields. (any text editor will do)
# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
# PATH="${HOME}/bin:${PATH}"
# fi
Restart CYGWIN.
Check and see if you have both .profile & .bash_profile in the working directory.
If you do, it's possible that the export command in both is actually conflicting in your shell. Making the output look something like this in Windows...
PATH="C:/Windows/path/to/repo/Windows/path/to/repo:$PATH"
export PATH
That's what happened to my bash shell anyway. It is correct that the 2 files interact with Bash or Cygwin differently, however if you have redundant inputs, they will compile together...
This answer for android build system error
For Python 3
If you get a "/usr/bin/env 'python' no such file or directory" error message, use one of the following solutions:
If your Ubuntu 20.04.2 LTS is a newly installed (vs. upgraded) Linux version:
sudo ln -s /usr/bin/python3 /usr/bin/python
f using Git version 2.19 or greater, you can specify --partial-clone when performing repo init. This makes use of Git's partial clone capability to only download Git objects when needed, instead of downloading everything. Because using partial clones means that many operations must communicate with the server, use the following if you're a developer and you're using a network with low latency:
repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
you can see document in
Downloading the Source

Categories

Resources