Skip to content Skip to sidebar Skip to footer

Can't Run Iperf3 On Android Without Root Permission

I need to make android application that run iperf3 library, so i have compiled 'iperf3' using android-ndk-r20 with changes made in iperf_api.c char buf[] = '/tmp/iperf3.XXXXXX'; I'

Solution 1:

I figured it out how to make it work. Before compile "iperf3" you need to change followed line in "iperf_api.c"

char buf[] = "/tmp/iperf3.XXXXXX";

to char buf[] = "/data/data/your.package.name/cache/iperf3.XXXXXX"; And it works fine! I hope I helped someone.

Solution 2:

It is also working when you set any of the following environment variable to writable directory (ie. cacheDir): TMPDIR or TEMP or TMP

For example: Os.setenv("TEMP", CACHE_DIR, true)

Temporary directory is checked in iperf_api.ciperf_new_stream function.

Post a Comment for "Can't Run Iperf3 On Android Without Root Permission"