The script can be downloaded here.
Set first argument as the package name you want to match, for example
net.kevxu.examplealso
net.kevxuwill match any application that starts with
net.kevxuThe rest of arguments will be passed to
adb.
net.kevxu.examplealso
net.kevxuwill match any application that starts with
net.kevxuadb.
vgaswitcheroo to force switch to Intel chip doesn't seem to work (others report it will only causes a blank screen).outb 0x7c2 1 outb 0x7d4 0x28 outb 0x7c2 2 outb 0x7d4 0x10 outb 0x7c2 2 outb 0x7d4 0x40 # Power down discrete graphics (won't work) #outb 0x7c2 1 #outb 0x7d4 0x50 #outb 0x7c2 0 #outb 0x7d4 0x50into one of the
menuentry inside grub.cfg. During booting, you will see a blank screen until intel driver is fully loaded. However, at this point, the discrete chip is still not powered down. According to apple-gmux driver,outb 0x7c2 1 outb 0x7d4 0x50 outb 0x7c2 0 outb 0x7d4 0x50should power down the discrete chip, however, after adding those commands into
grub.cfg, the system just won't boot up (stuck at blank screen, probably the kernel crashed).sudo.