Xcode 4.2 doesn't output exit code? - ios

Since updating to iOS 5 and Xcode 4.2, it appears that Xcode no longer prints "Program ended with exit code: #" on completion of a run. Has anyone else noticed this and is there any way to enable it again? I have an automated testing tool that relies on this output to determine if tests pass or not, so it would be very helpful to have it back.
UPDATE: I looked into this in more detail, and it seems to be a deeper problem. It appears that whenever I run an app, it crashes with a segmentation fault on exit. Sometimes this occurs just before the exit code is printed, sometimes right after, which is why the exit code message appears inconsistently. The seg fault message appears in the device's console, though there is nothing in the Xcode debug output.

I just noticed this too. It seems that in Xcode 4.1 (tty /dev/ttys000) gdb is started like this:
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000
But in Xcode 4.2 - No tty /dev/ttys000:
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
To fix this you can do the following from a command line (Terminal.app/iTerm/etc):
echo 'tty /dev/ttys000' >> ~/.gdbinit
# Or, put it into the global gdb config:
# echo 'tty /dev/ttys000' >> /etc/gdb.conf
Then restart Xcode, and you have your exit code back!
Seems that Xcode 4.2's gdb wrapper has changed since 4.1
[ 13:29 Jonathan#MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
-rwxrwxr-x 1 root admin 351936 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
-rwxrwxr-x 1 root admin 353776 Oct 8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
[ 13:33 Jonathan#MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x 1 root admin 1976144 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x 1 root admin 1948240 Oct 8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB

Related

react-native run-ios Could not connect to development server npm: '7.19.1' and node : 16.6.0, macincloud.com enviorment

I am using a rdp machine on macincloud.
i am running below commands and failing with "Could not connect to development server"
react-native run-ios
error:
[![enter image description here][1]][1]
Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
- WiFi is enabled and connected to the same network as the Node Server
URL: http://103.228.153.185:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Appui
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0
additionally though the debugger connects http://103.228.153.185:8081/debugger-ui/
but in console there is failure with attaching screenshot
i have also added url in Appdelegate.m
return [NSURL URLWithString:#"http://103.228.153.185:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.AppUI"];
i have removed the node_module, clear temp directory,started node server with clean cache, did npm install, nothing seems to work.
other enviorment spec:
node : 16.6.0
npm version
{
npm: '7.19.1',
node: '16.6.0',
v8: '9.2.230.21-node.18',
uv: '1.41.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.17.1',
modules: '93',
nghttp2: '1.42.0',
napi: '8',
llhttp: '6.0.2',
openssl: '1.1.1k+quic',
cldr: '39.0',
icu: '69.1',
tz: '2021a',
unicode: '13.0',
ngtcp2: '0.1.0-DEV',
nghttp3: '0.1.0-DEV'
}
I think this is a environment issue, Any help would be greatly appreciated
Note: app works fine in android
RCA:
This is happening because react-native needs watchman to run in ios, at the same time my user in macincloud.com didn't have privilege to access the watchman that is installed in the machine.
I saw the lack of access privilage from the "npm start" start log.
Welcome to Metro!
Fast - Scalable - Integrated
To reload the app press "r"
To open developer menu press "d"
2021-09-17T19:36:21,739: [] while computing sockname: failed to create /usr/local/var/run/watchman/user-state: Permission denied
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2021-09-17T19:36:21,739: [] while computing sockname: failed to create /usr/local/var/run/watchman/user-state: Permission denied
Solution:
From the error it was obvious that watchman is installed ,but user name cant access it, So what i did is i copied the folder of watchman to a location that i can access and provided the same path in bashrc. As to how i decided which path is needed to go to bashrc. I checked the installation step of watchman on https://facebook.github.io/watchman/docs/install.html,
if you see in the mac installation section, they only copy bin and lib like the below command, note:react-native is not concerned about exact location of watchman, all it wants is to access watchman.
$ sudo cp bin/* /usr/local/bin
$ sudo cp lib/* /usr/local/lib
Exact steps to follow to make this issue go away in macincloud.com or any machine where you are not root and do not have access privilage
cd /Users/{place-your-username}/Documents
mkdir watchman
cd /usr/local/bin/
ls -lart|grep watchman
lrwxr-xr-x 1 temp admin 45 Sep 17 23:04 watchman -> ../Cellar/watchman/2021.09.06.00/bin/watchman
lrwxr-xr-x 1 temp admin 50 Sep 17 23:04 watchman-diag -> ../Cellar/watchman/2021.09.06.00/bin/watchman-diag
lrwxr-xr-x 1 temp admin 50 Sep 17 23:04 watchman-make -> ../Cellar/watchman/2021.09.06.00/bin/watchman-make
lrwxr-xr-x 1 temp admin 68 Sep 17 23:04 watchman-replicate-subscription -> ../Cellar/watchman/2021.09.06.00/bin/watchman-replicate-subscription
lrwxr-xr-x 1 temp admin 50 Sep 17 23:04 watchman-wait -> ../Cellar/watchman/2021.09.06.00/bin/watchman-wait
lrwxr-xr-x 1 temp admin 48 Sep 17 23:04 watchmanctl -> ../Cellar/watchman/2021.09.06.00/bin/watchmanctl
Note: from above you see wathman is present in the machine, for the below command change the version number with respect what you get in the above response
cp -r ../Cellar/watchman/2021.09.06.00/ /Users/{place-your-username}/Documents/watchman
echo $PATH
bashrc might not be present at all and you have to create it for the first time,its ok
vi ~/.bashrc
PATH:/Users/{place-your-username}/Documents/watchman/bin:/Users/{place-your-username}/Documents/watchman/lib:{add-response from above function here or just add $PATH}
source ~/.bashrc
Now you can start your react machine
Note: This should work all machines where you want access to certain app which you want access to but due to privilege you are blocked

How messages from printf are routed to the terminal?

Lets say I have opened two tabs in the konsole (Tab1 and Tab2).
When I run tty in both of them I have:
Tab1:
~$ tty
/dev/pts/23
Tab2:
~$ tty
/dev/pts/24
If I run a simple program hello.c with a printf("Hello") in Tab1, how the system goes from writing to the stdout (file id 1) to writing to /dev/pts/23, being read by the konsole and then appearing in Tab1?
How the system know it has to give the "Hello" string to /dev/pts/23 and not to /dev/pts/24? And how it does that?
Is there a parameter given by the bash to the program so it knows which psudoterminal to send the "Hello"? Or the program sends the string back to the bash (how?) who knows to which pseudoterminal to send the data?
Thank you for your help
If you look at your process open files, you can see that the STDOUT,STDERR, etc points to the specific psuedo terminal that you already figured out using tty in your question
root#hello:~# ls -l /proc/self/fd
total 0
lrwx------ 1 root root 64 May 21 02:18 0 -> /dev/pts/3
lrwx------ 1 root root 64 May 21 02:18 1 -> /dev/pts/3
lrwx------ 1 root root 64 May 21 02:18 2 -> /dev/pts/3
As you might know, a process is created by a fork system call that actually duplicates the open file descriptors from the parent. so basically, your process gets the file descriptors from its parent.
How did the parent hot these associated with him ? well, konsole already dealt with that.

Device Tree for SPI0 not loading during Beaglebone Black Boots up

I am presently using Debian GNU/Linux 7.9 (wheezy) [Kernel version 3.8.13-bone70] on the BBB. Everything works fine until I reboot the BBB. Before rebooting, I do the following to verify If the SPI0 is enabled.
root#beaglebone:/sys/devices/bone_capemgr.9# echo ADAFRUIT-SPI0 > slots
root#beaglebone:/sys/devices/bone_capemgr.9# cat slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
**8: ff:P-O-L Override Board Name,00A0,Override Manuf,ADAFRUIT-SPI0**
The 8th slot is loaded with SPI 0
root#beaglebone:~# ls -al /dev/spidev*
crw-rw---T 1 root spi 153, 0 Feb 14 05:53 /dev/spidev1.0
Its showing spidev1.0, so its fine
root#beaglebone:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
group: spi0_pins_s0
pin 84 (44e10950),
pin 85 (44e10954),
pin 86 (44e10958),
Its showing the SPI pins.
root#beaglebone:~# sudo nano /boot/uEnv.txt
I opened the uEnv.txt file and added this line, so that the SPI0 DT will load during system boot up
optargs=capemgr.enable_partno=ADAFRUIT-SPI0
Problem: Why isn't my SPI0 DT being loaded during system boot up?, after a reboot I did the first three steps mentioned above to check, but noticed that the DT fails to load after rebooting. why is this happening?
After a while of researching, I got the solution for this. Sadly, entering "optargs=capemgr.enable_partno=ADAFRUIT-SPI0" in the uEnv.txt does not load the device tress during system boot up.
One solution I found was to include line "echo ADAFRUIT-SPI0 > /sys/devices/bone_capemgr.9/slots" in /etc/rc.local as mentioned here!.
Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.

Cannot execute gradle from the command line even though it's on my path

I have the following in ./bash_profile
export SRCROOT=/users/benjamin.beasley/work/svn/ccdev
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk_dev/Contents/Home
export PATH=$PATH$:~/tools/tools-versions/gradle-2.2.1/bin
export PATH=$PATH$:~/tools/activator
In ~/tools/tools-versions/gradle-1.12/bin, I do
drwxr-xr-x# 4 xxx.xxx WORKDAYINTERNAL\Domain Users 136 Nov 12 11:47 .
drwxr-xr-x# 13 xxx.xxx WORKDAYINTERNAL\Domain Users 442 Apr 29 2014 ..
-rwxr-xr-x# 1 xxx.xxx WORKDAYINTERNAL\Domain Users 5071 Apr 29 2014 gradle
-rwxr-xr-x# 1 xxx.xxx WORKDAYINTERNAL\Domain Users 2395 Apr 29 2014 gradle.bat
echo $PATH$:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin$:/Users/xxx.xxx/tools/tools-versions/gradle-2.2.1/bin$:/Users/xxx.xxx/tools/activator90566
so I get the gradle executable which is executable. I can execute it from this directory. But if I start a new shell, and type "gradle" it says command not found. But I "echo $PATH$" and I see that the full canonical path to the ~/tools/tools-versions/gradle-2.2.1/bin folder is there.
However I can execute activator which is an executable in the ~/tools/activator directory. I have no clue why bash knows about activator and not gradle.
In summary:
gradle is executable by this user
gradle can be run from the command line.
gradle is in the $PATH$ environment variable
other programs such as activator, which are also in $Path$ are executable anywhere in terminal regardless of directory which is what I want to be true of gradle.
Unix environment variables are $PATH not $PATH$ (they aren't like Windows env vars).
This is causing your problem.
This path is busted: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin$:/Users/xxx.xxx/tools/tools-versions/gradle-2.2.1/bin$:/Users/xxx.xxx/tools/activator90566
Notice the 90566 at the end? That's from $$ having been expanded to the current process id when you set the variable.
None of these are paths that actually exist or work:
/opt/X11/bin$
/Users/xxx.xxx/tools/tools-versions/gradle-2.2.1/bin$
/Users/xxx.xxx/tools/activator90566

While creating a project specific gemset for a new rails application, got this error: .ruby-version is not empty, moving aside to preserve

Specifically, this is what I typed into terminal and what came back:
$ mkdir myapp
$ cd myapp
$ rvm use ruby-2.1.0#myapp --ruby-version --create
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0#myapp
ruby-2.1.0 - #generating myapp wrappers.
Using /usr/local/rvm/gems/ruby-2.1.0 with gemset myapp
.ruby-version is not empty, moving aside to preserve.
.ruby-gemset is not empty, moving aside to preserve.
$ ls -la .ruby*
-rw-rw-r-- 1 danisyellis staff 6 Jan 24 14:26 .ruby-gemset
-rw-rw-r-- 1 danisyellis staff 6 Jan 24 14:26 .ruby-gemset.01.24.2014-14:26:06
-rw-rw-r-- 1 danisyellis staff 11 Jan 24 14:26 .ruby-version
-rw-rw-r-- 1 danisyellis staff 11 Jan 24 14:26 .ruby-version.01.24.2014-14:26:06
$ cat .ruby*
myapp
myapp
ruby-2.1.0
ruby-2.1.0
I've searched the internet for that error message and haven't found anything that explains it so I don't know what it means.
It almost looks like my computer ran the command twice and tried to create a duplicate?
Questions:
Is that what happened or was it something else?
If yes, why did it do that?
What does "moving aside to preserve" mean?
Is there anything I can change/clean up so that everything works properly and cleanly
Thanks so much for any help you can give! I'm pretty new to all this so answers with a decent amount of detail/hand-holding would be appreciated.
this looks like a bug, please report it here: https://github.com/wayneeseguin/rvm/issues
in the mean time ignore this bug, you can remove the duplicate files quite easily:
rm -f .ruby-*\.*

Resources