frida-core icon indicating copy to clipboard operation
frida-core copied to clipboard

Failed to attach: timeout was reached

Open IdoBn opened this issue 8 years ago • 10 comments

Running frida-server on an android emulator Then running frida-ps -D <emulator identifier> works However when running frida-trace -i "open" -D <emulator identifier> com.android.chrome I receive this error Failed to attach: timeout was reached

frida-trace version 10.6.32 frida-ps version - 10.6.32 frida-server version - 10.6.32-android-x86

I'm running frida on Mac High Sierra
The emulator is running android 7.0

IdoBn avatar Jan 12 '18 16:01 IdoBn

I get the same running on a rooted Nexus 5, running Android 6.0.1 (SELinux is set to permissive). Version 10.6.52, I'm running the client from Fedora Linux.

It times out on "Resolving functions...", gives the time out message, which causes the adb server to crash.

Strangely enough it works fine if I run the frida client from Windows, so I'm suspecting that the adb server on Fedora is broken.

tautology0 avatar Feb 13 '18 15:02 tautology0

I get the same error on Win10 with a regular executable. frida-trace version 10.6.58.

luh2 avatar Mar 13 '18 14:03 luh2

Here the same:(

frida-ps -U works fine on Genymotion - Android 7.0.0, but if I run frida-trace -U -i recv package.of.app I get:

Attaching... Failed to attach: timeout was reached

I have frida version: 12.2.18

Lena900925 avatar Oct 27 '18 16:10 Lena900925

Same for me with frida-trace version 12.4.8 and a Nexus 5 (Lineage OS 14.1 / Android 7.1.2))

kmille avatar Apr 27 '19 20:04 kmille

What worked for me is using 'setenforce permissive' before starting the frida-server

kmille avatar Apr 28 '19 13:04 kmille

@IdoBn Downgrade your frida-server version on your android devices. For example, if you have frida-version 10.6.32 on your PC, you can install frida-server 10.0.X. Note: only master version should match between frida-server and frida.

RoyalFlushever avatar Nov 08 '19 03:11 RoyalFlushever

Ran into this problem on a jailbroken iPhone 6S (checkra1n) running frida (on the desktop) frida-server (on the device) version 12.8.11. I upgraded both versions to 12.8.20 and attaching works again.

Update: I actually just saw this again, and the solution this time was just rebooting the phone. (Which of course involved re-jailbreaking it.) So the frida upgrade may have been a red herring.

nk9 avatar Apr 11 '20 17:04 nk9

frida: 15.1.17 Android11 "reboot the mobile" or even "reboot the pc" or "setenforce permissive" nothing works for me. Finally start the frida-server with -P works immediately.

MaeThird avatar Mar 18 '22 10:03 MaeThird

@MaeThird I don't understand, can I tell you the command I used? I'm new using this tool.

LucioDarcon avatar Jan 04 '24 04:01 LucioDarcon

I receive also this error message "Failed to attach: timeout was reached" from frida-trace setenforce permissive and starting frida-server with -P don't make a difference.

Running frida-server on arm32 LineageOS 20 (Android 13) and frida-trace on Linux frida-trace and frida-server version 16.6.3

When setenforce permissive isn't set, frida-server immediately gives the output:

{"type":"error","description":"Error: invalid instruction","stack":"Error: invalid instruction\n    at Function.value (frida/runtime/core.js:481:1)\n    at Tn (frida/node_modules/frida-java-bridge/lib/android.js:1748:1)\n    at frida/node_modules/frida-java-bridge/lib/android.js:1626:1\n    at Object.value [as patchCode] (frida/runtime/core.js:227:1)\n    at In (frida/node_modules/frida-java-bridge/lib/android.js:1625:1)\n    at vt (frida/node_modules/frida-java-bridge/lib/android.js:579:1)\n    at frida/node_modules/frida-java-bridge/lib/memoize.js:4:1\n    at bt (frida/node_modules/frida-java-bridge/lib/android.js:574:1)\n    at frida/node_modules/frida-java-bridge/lib/class-model.js:112:1\n    at Function.build (frida/node_modules/frida-java-bridge/lib/class-model.js:7:1)","fileName":"frida/runtime/core.js","lineNumber":481,"columnNumber":1}

Followed by "Illegal instruction" When setenforce permissive is set, frida-server gives after some time the same output, without "Illegal instruction"

On an x86_64 Android 13 emulator it works without problems. It also works when frida-server is running on arm64 Android 14 Genesis OS Utopia 1.0 When frida-server is running on a rooted arm32 TicWatch pro WearOS watch, frida-trace -U -i open -N application-ID also works. I also tried it with an Android 4.4 and an Android 5.1.1 arm32 phone, both rebooted and it didn't work.

j-kaltes avatar Jan 16 '25 17:01 j-kaltes