Cartucho / android-touch-record-replay

How to record and replay touchscreen events on an Android device.
Apache License 2.0
224 stars 46 forks source link

Compiling for arm64 architecture #18

Closed novakin closed 4 years ago

novakin commented 4 years ago

Hi,

Unfortunately the mysendevent wont work on my device (oneplus 6). I'm totally new to compiling.

Here is what i achieved so far and im getting an error

aarch64-linux-gnu-gcc -static -march=armv8-a mysendevent.c mysendevent
[418e35e] /usr/lib/gcc-cross/aarch64-linux-gnu/8/../../../../aarch64-linux-gnu/bin/ld: mysendevent: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

Can anyone please provide some good ressources related to compiling ? Or if you compiled it yourself could you please share it

Thanks in advance

novakin commented 4 years ago

I finally found out how to make it work

Download Android NDK from https://developer.android.com/tools/sdk/ndk/index.html

Extract the NDK tar xf android-ndk-r20-*.tar.bz2 && cd android-ndk-r20

Make GNU Android Toolchain from NDK (edit the platform according to your android version) build/tools/make-standalone-toolchain.sh --toolchain=aarch64-linux-androideabi-4.9 --platform=android-28 --install-dir=../toolchain

Crosscompile cd ../toolchain/bin aarch64-linux-android-gcc --static ../../android-touch-record-replay/mysendevent.c -o ../../android-touch-record-replay/mysendevent

Cartucho commented 4 years ago

Unfortunately, I do not really understand why this happened. Do you think it has to do with the device? Which android version are you using?

novakin commented 4 years ago

No idea, but compiling using NDK tools worked, so its the most important.

Cartucho commented 4 years ago

Hello, do you could submit a PR with the file compiled for 64 bit?

I wanted to include both in the repo to make sure everyone could use it directly.

novakin commented 4 years ago

Hi,

Sure no problem.

Edit : Done #20