QtCreator - Debugging as superuser on Mac OS - debugging

I'd like to debug an application in QtCreator on Mac OS which reads directly from hard disk (/dev/rdisk0). If I run this app from Terminal using sudo ./MyApp, it's working, however when I debugging it under QtCreator, it fails due to lack of permissions.
I tried to launch QtCreator itself from terminal using "sudo open QtCreator.app", but it didn't help.
Please suggest how to get around it.
Serge.

Assuming you installed QtCreator into /Developer/Applications, you probably have to do:
sudo /Developer/Applications/Qt/QtCreator.app/Contents/MacOS/QtCreator
If QtCreator is a Carbon application, then you might need to execute:
sudo -b /System/Library/Frameworks/Carbon.framework/Versions/Current/Support/LaunchCFMApp /Developer/Applications/Qt/QtCreator.app
See also: Open GUI applications as root - Mac Forums.

Related

Terminal not working in Aptana IDE with OSX

This Terminal Emulator is not functional because no 'bash' shell could be found.
Please correct the problem and restart the ID
This is a brand new OSX laptop with 10.13.6, and I've been trying to replicate the setup with aptana 3. I'm not sure what I'm missing to be getting this error... previous threads with similar errors all seem to be dealing with windows environments
I had the same issue on macOS Mojave 10.14 with AptanaStudio 3.7.2 and could fix it based on the suggestion here (which is for linux) https://stackoverflow.com/a/6685532/5220160
So assuming your AptanaStudio.app sits in /Applications the fix would be chmod +x /Applications/AptanaStudio.app/Contents/Eclipse/plugins/com.aptana.terminal_3.0.0.201802081530/os/macosx/redtty

How to install gdb on MacOS terminal Sierra

I searched online about how to install gdb on macOS Sierra 10.12.2 but failed on the methods I could find. Then I figure out the following way which is easy and works fine on my machine. hope it may help you too:)
download the most recent GDB from https://www.sourceware.org/gdb/download/
expand the gdb-7.12.1.tar.xz file: tar xopf gdb-7.12.1.tar.xz
cd gdb-7.12.1 in terminal to open the gdb folder
then follow the instructions in the README file in the gdb folder, or simply follow the following steps:
./configure, wait for the terminal
make and wait again (which can take some time)
sudo make install
Now gdb is installed at /usr/local/bin/
Note that you might want to try/use LLDB (lldb) instead. This is now the default (don't know about 10.12, but on 10.13 it is installed, when you install the Xcode utilities). It even comes with a nice curses GUI, but otherwise a shell very similar to GDB.
You can also use homebrew to get gdb in mac os:
install-gdb-macos-sierra
Surprised no one mentioned:
brew install gdb
How to install brew?

OS X Terminal hangs installing vNext KVM after running "source kvm.sh"

I'm trying to install vNext on my Macbook but when I run source kvm.sh the terminal just hangs.
My setup:
OSX 10.9.5 (Mavericks)
Mono 3.10.0
My problem:
I followed the instructions for installing vNext on OS X from the GitHub repo:
https://github.com/aspnet/Home
Essentially:
brew tap aspnet/k
brew install kvm
source kvm.sh
Everything seems to go fine until the step where I run source kvm.sh, which hangs the terminal with a message "[Process completed]".
Adding source kvm.sh to ~/.zshrc file starts the terminal and immediately hangs it once that runs.
What I've tried:
I uninstalled kvm (brew uninstall kvm) and aspnet/k (brew untap aspnet/k) and deleted the directory ~/.kre, then tried reinstalling it all again.
No luck.
Any ideas? Here's a screenshot:
The kvm currently not working in ZSH, Running it under /bin/bash should work quite well.
Also, make sure you remove anything to do with kvm from your .zshrc file and you should be good to go again.
according to https://github.com/aspnet/kvm/issues/83 , you can replace the kvm.sh file with the version from dev branch, which can be found under https://github.com/aspnet/kvm/blob/dev/src/kvm.sh , and zsh should be happy with it afterwards.
Worked for me.

How to make Apple X11 the default X11 app?

I have OS X mavericks. Yesterday I installed xQuartz but then decided that I want to make Apple's X11 the default X11 eninronemnt. I check the website of xQuartz where it said I should run the following commands:
(XQuartz.app) launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
(Apple's X11.app) launchctl unload -w /System/Library/LaunchAgents/org.x.startx.plist
(MacPorts' X11.app) launchctl unload -w /Library/LaunchAgents/org.macports.startx.plist
The first command runs correctly, but the last two gives me that there's no such file or directory error. So now how can I make Apple's X11 the default?!
From XQuartz's faq:
Uninstall (Snow Leopard or Later)
XQuartz does not replace the system X11 on Snow Leopard, so you can go
back to the Apple-provided X11.app rather easily. Just launch X11.app
rather than XQuartz.app to get the older server. If you want to make
Apple's X11.app the default server (owning the launchd $DISPLAY
socket), then you should disable the
org.macosforge.xquartz.startx.plist as described in the first
question. After logging out and back in, Apple's X11.app will be
default. If you still want to remove XQuartz.app from your system, you
can do that with these two steps:
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
Please file a bug report
to let us know why you reverted to the system X11.app, so we can
address the problem in a future release.
Apple's X11 is no longer supported in Mavericks. You can run it but it may not work. Only xQuartz has been updated and supported up to Mavericks. The old apple's x11 no longer comes with the operating system. As a matter of fact, you can't install it unless you have access to an old install disk or obtain the file from someone else. Apple even suggests to install XQuartz instead. So unless you managed to install apple's old x11 by hand, that file shouldn't exist.

using x11 emacs in mountain lion

I have been trying to use macport's installation by using sudo port install emacs +x11 on my laptop with mountain lion, but every time I open emacs in terminal, it opens in the terminal without any GUI. This also happens if I try to open emacs directly in an xquartz terminal session. Has anyone had any luck with installing the x11 version of emacs on mountain lion? And if so, how? Thank you!
Turns out apple cut the link between terminal and xquartz. If I open emacs in xterm, it will run just fine. I found this to be the case even when I was using terminal with an ssh server. Looks like apple's terminal isn't going to be all that helpful from here on out.
Edit; I'm not sure if it was an update to xQuartz, but the problem has been fixed. When I type in an x11 app into the normal terminal app, it will open xQuartz as normal.

Resources