Skip to content

Instantly share code, notes, and snippets.

@samchoi69
Forked from CHEF-KOCH/Remove BlueStacks Ads
Last active January 6, 2026 16:57
Show Gist options
  • Select an option

  • Save samchoi69/75d9bd164597338ff116b5a441e41a83 to your computer and use it in GitHub Desktop.

Select an option

Save samchoi69/75d9bd164597338ff116b5a441e41a83 to your computer and use it in GitHub Desktop.
Remove BlueStacks Ads
# Windows
1. Open Windows Command Prompt
2. Run command
"C:\Program Files (x86)\BlueStacks\HD-Adb.exe" shell
# Within BlueStacks shell
/system/xbin/bstk/su
pm disable-user com.bluestacks.s2p
# macOS
1. Open Terminal
2. Run command:
/Applications/BlueStacks.app/Contents/MacOS/adb shell
# Within BlueStacks shell
/system/xbin/bstk/su
pm disable-user com.bluestacks.s2p
# Error: device not found
# Kill the server with ADB
# Make sure BlueStacks is running before you try to start ADB and disable the user
# Windows
"C:\Program Files (x86)\Bluestacks\HD-Adb.exe" kill-server
#macOS
/Applications/BlueStacks.app/Contents/MacOS/adb kill-server
@Learn000
Copy link

Whenever I start the daemon, it starts, then after a few seconds it says . I'm not sure what to do, and I have even restarted the server a few times. I am running bluestacks 4error: closed

i have this problem too

Copy link

ghost commented Jan 13, 2021

Maybe get root by this link and try running the above except replacing /system/xbin/bstk/su to su?
Shoot, still does not work because package does not exist, maybe Bluestacks patched this?

@MarshMeadow
Copy link

we need an updated version..

@robbert1978
Copy link

robbert1978 commented Dec 23, 2024

This is the new method that I used
First, you need to install WSL or Linux VM. I used WSL.

Open WSL in C:\ProgramData\BlueStacks_nxt\Engine\Pie64:

cd /mnt/c/ProgramData/BlueStacks_nxt/Engine/Pie64
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 Root.vhd 
sudo debugfs -w /dev/nbd0p1

( If you dont't have qemu-nbd and debugfs, try to install it via apt. )

Now we see, we can edit Root.vhd :
type ls:
image

In debugfs prompt:

cd android
dump ./system/etc/hosts /tmp/hosts

It will dump ./system/etc/hosts of Root.vhd to /tmp/hosts of your Linux machine.

Edit /tmp/hosts:

127.0.0.1       localhost
::1             ip6-localhost
127.0.0.1       coinhive.com
127.0.0.1 adservice.google.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 googleads.g.doubleclick.net
0.0.0.0 cloud.bluestacks.com
0.0.0.0 cloud-api-cdn.bluestacks.com
0.0.0.0 cdn-icon.bluestacks.com
0.0.0.0 cdn-bgp.bluestacks.com
0.0.0.0 bluestacks.com
0.0.0.0 www.bluestacks.com

In debugfs prompt:

unlink ./system/etc/hosts
write /tmp/hosts ./system/etc/hosts
q

Use:

sudo qemu-nbd -d /dev/nbd0

to detach the disk file.

Now we see the ads is removed.

image

Update:

You can disable its own laucher by running:

pm disable-user com.uncube.launcher3

But before doing it, remember to install alternative laucher ( like Nova ).

I recommend this.

Notice

Why I know those hosts:

I used Http Toolkit to hook https requests of Bluestack launcher app:

image

@abidzk01
Copy link

@gamer2vr
Copy link

gamer2vr commented Mar 8, 2025

How I fix this?

image

@Jorge9811
Copy link

This is the new method that I used First, you need to install WSL or Linux VM. I used WSL.

Open WSL in C:\ProgramData\BlueStacks_nxt\Engine\Pie64:

cd /mnt/c/ProgramData/BlueStacks_nxt/Engine/Pie64
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 Root.vhd 
sudo debugfs -w /dev/nbd0p1

( If you dont't have qemu-nbd and debugfs, try to install it via apt. )

Now we see, we can edit Root.vhd : type ls: image

In debugfs prompt:

cd android
dump ./system/etc/hosts /tmp/hosts

It will dump ./system/etc/hosts of Root.vhd to /tmp/hosts of your Linux machine.

Edit /tmp/hosts:

127.0.0.1       localhost
::1             ip6-localhost
127.0.0.1       coinhive.com
127.0.0.1 adservice.google.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 googleads.g.doubleclick.net
0.0.0.0 cloud.bluestacks.com
0.0.0.0 cloud-api-cdn.bluestacks.com
0.0.0.0 cdn-icon.bluestacks.com
0.0.0.0 cdn-bgp.bluestacks.com
0.0.0.0 bluestacks.com
0.0.0.0 www.bluestacks.com

In debugfs prompt:

unlink ./system/etc/hosts
write /tmp/hosts ./system/etc/hosts
q

Use:

sudo qemu-nbd -d /dev/nbd0

to detach the disk file.

Now we see the ads is removed.

image

Update:

You can disable its own laucher by running:

pm disable-user com.uncube.launcher3

But before doing it, remember to install alternative laucher ( like Nova ).

I recommend this.

Notice

Why I know those hosts:

I used Http Toolkit to hook https requests of Bluestack launcher app:

image

Is there an alternative that doesn't require wsl or that is compatible with wsl1?

These exact steps don't work on wsl1 because it lacks the nbd module :(

@Jorge9811
Copy link

Okay this isn't exactly an alternative but here's what I did.

I flipped and double checked a handful of configs in C:\ProgramData\BlueStacks_nxt\bluestacks.conf, more specifically these:

bst.feature.rooting="1"
bst.feature.nowbux="0"
bst.feature.nowgg_login_popup="0"
bst.feature.bluestacksX="0"
bst.instance.Rvc64.enable_root_access="1"
bst.feature.auto_upload_nowgg_moments="0"
bst.feature.send_internal_notification_stats="0"
bst.feature.send_notification_stats="0"
bst.feature.send_nowbux_login_boot_stats="0"
bst.feature.send_offer_stats="0"
bst.feature.send_programmatic_ads_boot_stats="0"
bst.feature.send_programmatic_ads_click_stats="0"
bst.feature.send_programmatic_ads_fill_stats="0"
bst.feature.skipNowggLogin="1"
bst.instance.Rvc64.nowbux_signin_completed="0"
bst.instance.Rvc64.nowgg_email=""
bst.instance.Rvc64.nowgg_userAvatarUrl=""
bst.instance.Rvc64.nowgg_userId=""
bst.instance.Rvc64.nowgg_username=""
bst.instance.Rvc64.show_nowbux_rewards_red_dot_onboarding="0"
bst.feature.programmatic_ads="0"

Note: rvc64 is the code for Android 11. I use Android 11 on Bluestacks.

Then I made the file Read-Only to avoid Bluestacks messing with it, then I booted up Bluestacks and installed a launcher of my choice.

Having enabled root with some of the prefs above, I used this apk, UninstallSystemApps to uninstall a handful of things, now.gg packages and the Home launcher mainly.
Bluestacks works a bit better than before now, and the launcher I installed is hyper minimalistic and fast.
If there's anything else to add or improve here, let me know.

@robbert1978
Copy link

android

Did you try the absolute path /android/system/etc/hosts

@robbert1978
Copy link

Okay this isn't exactly an alternative but here's what I did.

I flipped and double checked a handful of configs in C:\ProgramData\BlueStacks_nxt\bluestacks.conf, more specifically these:

bst.feature.rooting="1" bst.feature.nowbux="0" bst.feature.nowgg_login_popup="0" bst.feature.bluestacksX="0" bst.instance.Rvc64.enable_root_access="1" bst.feature.auto_upload_nowgg_moments="0" bst.feature.send_internal_notification_stats="0" bst.feature.send_notification_stats="0" bst.feature.send_nowbux_login_boot_stats="0" bst.feature.send_offer_stats="0" bst.feature.send_programmatic_ads_boot_stats="0" bst.feature.send_programmatic_ads_click_stats="0" bst.feature.send_programmatic_ads_fill_stats="0" bst.feature.skipNowggLogin="1" bst.instance.Rvc64.nowbux_signin_completed="0" bst.instance.Rvc64.nowgg_email="" bst.instance.Rvc64.nowgg_userAvatarUrl="" bst.instance.Rvc64.nowgg_userId="" bst.instance.Rvc64.nowgg_username="" bst.instance.Rvc64.show_nowbux_rewards_red_dot_onboarding="0" bst.feature.programmatic_ads="0"

Note: rvc64 is the code for Android 11. I use Android 11 on Bluestacks.

Then I made the file Read-Only to avoid Bluestacks messing with it, then I booted up Bluestacks and installed a launcher of my choice.

Having enabled root with some of the prefs above, I used this apk, UninstallSystemApps to uninstall a handful of things, now.gg packages and the Home launcher mainly. Bluestacks works a bit better than before now, and the launcher I installed is hyper minimalistic and fast. If there's anything else to add or improve here, let me know.

I did try to modify bluestacks.conf but I saw BlueStack modify it again. I might need more time to research about this.
Anyway, if you need, I can upload a clean vhdx which removed ads to you.

@gamerzord
Copy link

anyone found a way to remove startup loading ads?

@MLSci
Copy link

MLSci commented Jul 3, 2025

PS>.\HD-Adb.exe shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: no devices/emulators found

And when I try the normal adb using the 5735 port -

PS>adb shell pm disable-user --user 0 com.bluestacks.s2p

Exception occurred while executing 'disable-user':
java.lang.IllegalArgumentException: Unknown package: com.bluestacks.s2p
        at com.android.server.pm.ComputerEngine.getApplicationEnabledSetting(ComputerEngine.java:5294)
        at com.android.server.pm.IPackageManagerBase.getApplicationEnabledSetting(IPackageManagerBase.java:342)
        at com.android.server.pm.PackageManagerShellCommand.runSetEnabledSetting(PackageManagerShellCommand.java:2360)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:274)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6179)
        at android.os.Binder.shellCommand(Binder.java:1049)
        at android.os.Binder.onTransact(Binder.java:877)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6163)
        at android.os.Binder.execTransactInternal(Binder.java:1285)
        at android.os.Binder.execTransact(Binder.java:1244)

@FelesNoctis
Copy link

FelesNoctis commented Jan 6, 2026

This is the new method that I used First, you need to install WSL or Linux VM. I used WSL.

(instructions here)

I figured I'd mention: as of Bluestacks 5.22.100, as far as I can tell, it seems to be aware that it's been tampered with and will terminate the android instance for "security reasons". Even reverting the hosts file edit won't fix this, requiring a full clean uninstall and reinstall. In my experience anyway.

EDIT:
Updated to add that this does seem to work on the MSI App Player, which is Bluestacks-based, and as of this post is on 5.22.75. This may indicate that either the "tampered" check is a new addition to Bluestacks, or that the MSI version just doesn't care. It did work, however, as their custom app-store believes it's been disconnected from the internet while everything else works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment