This repository is a fork of the original iPerf3 repository
specifically adapted for use with the OpenMobileNetworkToolkit developed by Fraunhofer FOKUS.
The primary goal of this fork is to make iPerf3 compatible with
Android Apps by replacing exit()
calls with longjmp();
.
Adapted versions of iPerf will be tagged with the format v3.XX.
You can download the latest libiperf from here, or you can build it locally with the Docker file:
docker build -t android-ndk:latest .
docker run -d --name android-ndk-container android-ndk
docker cp -a android-ndk-container:/tmp/iperf/jniLibs ./
Copy the executables to the jniLibs path, the default path is app/src/main/jniLibs
.
For every ABI a directory needs to be created.
It should look like this:
app/src/main/jniLibs/
├─ arm64-v8a/
│ ├─ libiperf3.12.so
├─ armeabi-v7a/
│ ├─ libiperf3.12.so
├─ x86/
│ ├─ libiperf3.12.so
├─ x86_64/
│ ├─ libiperf3.12.so
Load the Library
static {
System.loadLibrary("iperf3.15");
Log.i(TAG, "iperf.so loaded!");
}
Add the wrapepr function to the App
private native int iperf3Wrapper(String[] argv, String nativeLibraryDir);
Add the call to the App
iperf3Wrapper(cmd, getApplicationContext().getApplicationInfo().nativeLibraryDir);
For a working example have a look here
- android-iperf - Github
- iPerf - Github
- integrating iPerf - matt9j.net