Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Running from ADB (for testing)

Cherry edited this page Jul 5, 2022 · 2 revisions

Please follow these instructions for an example on how to setup magick to be run on Android for testing.

  • Download the static zip file and extract it. You will have a folder with 3 files: libc++_shared.so, libomp.so and magick.
  • Use ADB to put those files in a path where files can be executed from. The home path and the sdcard are not valid locations. For this example, I put the three files in a folder called magick and then ran adb push magick /data/local/tmp to push the whole folder into /data/local/tmp/magick
  • Run adb shell to get to the command line, and then change to the path where the files reside, and set the binary as executable:
    • cd /data/local/tmp/magick
    • chmod 0755 magick
  • If you try to run ./magick now, it will not work because it can't find the library path. You need to set up the environment variables:
    • export TMPDIR=/data/local/tmp
    • export MAGICK_HOME=/data/local/tmp/magick
    • export LD_LIBRARY_PATH=/data/local/tmp/magick
  • You can now run ./magick and it will give you the usage instructions. For example, this will capture the screen and then create a new PNG file with the 32x32 box at 500,500:
    • screencap -p screen.png
    • ./magick screen.png -crop 32x32+500+500 crop.png

Obviously setting up the environment variables every time would get tedious, so you should use a shell script for this.

Clone this wiki locally