commit | 448a174f823fbdbfc58194f5a5ce446bf4b2f5ed | [log] [tgz] |
---|---|---|
author | Joel Fernandes (Google) <joel@joelfernandes.org> | Tue May 29 12:23:18 2018 -0700 |
committer | Joel Fernandes (Google) <joel@joelfernandes.org> | Tue May 29 12:31:31 2018 -0700 |
tree | c0bb4bd5bbeec1082c920eaccd1abb44e3be23b7 | |
parent | fa32e59e703c49f2109d0d333cba4fc2e0e8c2eb [diff] |
androdeb: Remove 'buildtar' and prepare checks. - buildtar is not needed, since we have "prepare --buildtar" already - prepare can be specified without any options since all packages will be installed if prepare wasn't specified anything. So IOW, its perfectly legal to do: "androdeb prepare" Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
androdeb provides a powerful Linux shell environment where one can run popular and mainstream Linux tracing, compiling, editing and other development tools on an existing Android device. All the commands typically available on a modern Linux system are supported in androdeb.
Powerful development environment with all tools ready to go (editors, compilers, tracers, perl/python etc) for your on-device development.
No more cross-compiler needed: Because it comes with gcc and clang, one can build target packages natively without needing to do any cross compilation. We even ship git, and have support to run apt-get to get any missing development packages from the web.
Using these one can run popular tools such as BCC that are difficult to run in an Android environment due to lack of packages, dependencies and cross-compilation needed for their operation. Check BCC on Android using androdeb for more information on that.
No more crippled tools: Its often a theme to build a static binary with features disabled, because you couldn't cross-compile the feature's dependencies. One classic example is perf. However, thanks to androdeb, we can build perf natively on device without having to cripple it.
Target: An ARM64 android N or later device which has "adb root" supported. Typically this is a build in a userdebug configuration. Device should have atleast 2 GB free space in the data partition. If you would like to use other architectures, see the Other Architectures section.
Host: A machine running recent Ubuntu or Debian, with 4GB of memory and 4GB free space. Host needs debootstrap and qemu-debootstrap packages. To install it, run sudo apt-get install qemu-user-static debootstrap
. Other distributions may work but they are not tested.
git clone https://github.com/joelagnel/androdeb.git cd androdeb sudo ln -s ./androdeb /usr/bin/androdeb
# First make sure device is connected to system androdeb prepare --download
androdeb shell
CTRL + D
and you will exit out of the shell. To remove androdeb from the device, run:androdeb remove
If you have multiple devices connected, please add -s <serialnumber>
. Serial numbers of all devices connected can be obtained by adb devices
.
androdeb pull
androdeb prepare --download --kernelsrc /path/to/kernel-source
If you need to put kernel sources for an existing install, run:
androdeb prepare --kernelsrc /path/to/kernel-source
Note: The kernel sources should have been built (atleast build should have started).
The androdeb fs will be prepared locally by downloading packages as needed:
androdeb prepare --fullbuild
This is unlike --download
where the androdeb rootfs is itself pulled from the web.
androdeb prepare --fullbuild --kernelsrc /path/to/kernel-source/
--fullbuild
, customize what you install:androdeb prepare --editors --compilers
androdeb prepare --bcc --kernelsrc /path/to/kernel-source/
Note: BCC is built while being installed. Also --kernelsrc
is recommended for tools to function unless device has them already.
androdeb prepare --fullbuild --buildtar /path/
After device is prepared, it will extract the root fs from it and store it as a tar archive at /path/androdeb-fs.tgz
. This can be used later.
androdeb prepare --archive /path/androdeb-fs.tgz
androdeb prepare --buildimage /path/to/image.img
This can then be passed to Qemu as -hda. Note: This option doesn't need a device connected.
By default androdeb assumes the target Android device is based on ARM64 processor architecture. For other architectures, use the --arch option. For example for x86_64 architecture, run:
androdeb prepare --arch amd64 --bcc --kernelsrc /path/to/kernel-source/
Note: The --download option ignores the --arch flag. This is because we only provide pre-built filesystems for ARM64 at the moment.