You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After launching scrcpy v3.3.3, no screen mirroring appears, and the terminal shows no error messages.
However, when I use scrcpy v1.25, everything works normally.
When I compared the code of the two versions, I found a piece of useful code.
In the fillAppInfo method of Workarounds.java. Application app = Instrumentation.newApplication(Application.class, ctx);
So I modified the code in v3.3.3:
privatestaticvoidfillAppContext() {
try {
Applicationapp;
if (Build.BRAND.equalsIgnoreCase("meizu")) {
app = Instrumentation.newApplication(Application.class, FakeContext.get());
} else {
app = newApplication();
FieldbaseField = ContextWrapper.class.getDeclaredField("mBase");
baseField.setAccessible(true);
baseField.set(app, FakeContext.get());
}
// activityThread.mInitialApplication = app;FieldmInitialApplicationField = ACTIVITY_THREAD_CLASS.getDeclaredField("mInitialApplication");
mInitialApplicationField.setAccessible(true);
mInitialApplicationField.set(ACTIVITY_THREAD, app);
} catch (Throwablethrowable) {
// this is a workaround, so failing is not an errorLn.d("Could not fill app context: " + throwable.getMessage());
}
}
I have not tested the compatibility of this line of code, so I only added a simple condition check, but it does work for me.
I hope this can help with your compatibility work!
Activity
rom1v commentedon Nov 14, 2025
Looks good, it works on my devices too:
Thank you.
Create Application instance via instrumentation
rom1v commentedon Nov 23, 2025
Merged into
dev: 9cfa5b1Create Application instance via instrumentation
Merge tag 'v3.3.4' of https://github.com/Genymobile/scrcpy into master
ghazyahmdfwad-jpg commentedon May 10, 2026