I am running my build agent as a launch agent. I get this error when I try to run "xcodebuild test ..." :
2016-07-14 16:31:00.535 xcodebuild[11579:21390] [MT] iPhoneSimulator: Could not launch simulator: -10827 xcodebuild: error: Failed to build project XcodeTestsTest1 with scheme XcodeTestsTest1. Reason: The operation couldn’t be completed. (OSStatus error -10827.)
Do you have any idea about how can this issue be solved?
Thanks!
I had exact same issue.
It happens because Mac OS X doesn't allow an iOS simulator to run in the BACKGROUND.
If you are constructing a Jenkins CI environment, and trying to unit test via the simulator, you can't run the simulator, because Jenkins is basically run as a DAEMON. This also happens if you're running the tests behind environments like tmux or screen.
Here is a great tutorial to read that can help you fix this.
Cheers!
For me this helped
- close XCode & Simulator (if running)
- open Terminal and type:
ps -ax | grep simdeviceio | grep -v grep
this had some output on my Mac:
50755 ?? Ss 0:00.67 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/Resources/SimStreamProcessorServices.simdeviceio/Contents/XPCServices/SimStreamProcessorService.xpc/Contents/MacOS/SimStreamProcessorService
50756 ?? Ss 0:00.07 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/Resources/SimAudioProcessorServices.simdeviceio/Contents/XPCServices/SimAudioProcessorService.xpc/Contents/MacOS/SimAudioProcessorService
This 2 processes could either manually be killed by typing their PIDs (first number in above lines) with a kill command:
kill -9 50755 50756
or with
ps ax | grep simdeviceio | grep -v grep | awk '{print $1}' | xargs kill -9
Go to the apple icon (top left of screen), then force quit then select the simulator
Run the project again
If you run
xcrun simctl boot "iPhone 7"
then
run xcodebuild test
then after cleanup with
xcrun simctl shutdown "iPhone 7"
Note: you have to have an active user session running somewhere on the box you are trying to run this on.
Related
How to use Robot framework to write Record 15 secs Android adb log after enter Ctrl+c to automatically execute the function in Terminal and Windows CMD??
adb shell logcat -b crash > log_carsh_date.txt
Record 15 secs
Enter Ctrl+c
Can you help me? Thank you.
${result} = Run adb shell logcat -b crash > log_carsh_date202221027.txt
Sleep 15s
AutoItLibrary.Send {^c}
Instead of using OperatingSystem.Run you most probably would be better served by using Run Process keyword from Process Library. You can see there the arguments for capturing the output directly and setting a timeout.
I have never used logcat but the command would probably look something like this
${result}= Run Process adb shell logcat -b crash > log_carsh_date202221027.txt timeout=15s
The ${result} is a result object, which you can get different properties out of after the run as explained in the documentation.
My deployments fail on last step Validate Service with error message:
The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.
Events log
No lines are selected.
My validate_service.sh contain
#!/bin/bash
# verify we can access our webpage successfully
curl -v --silent localhost:80 2>&1 | grep Welcome
Can someone advice what should I change ?
Script return value matters. Yours looks good to me. I just added couple of seconds to wait until application starts up.
In case you use bash -x together with pipeline of commands, you better add shopt -s pipefail so all pipeline fails when one of the commands fails.
Checkout my script:
#!/bin/bash
sleep 5
curl http://localhost:3009 | grep Welcome
I want to launch my test suite from a bash script using the & operator in background mode b/c I want my bash script to do something else while the test suite is running.
This doesn't seem possible ATM. What I see is:
$ dotnet test --filter "FullyQualifiedName~GenerateTransactions" >> dotnet.log 2>&1 &
[1] 2068
Tailing the log file for 5 minutes doesn't show me anything. Then pressing Enter in the terminal where I started the tests appears to show me that the dotnet process has stopped
$ <press Enter>
[1]+ Stopped dotnet test --filter "FullyQualifiedName~GenerateTransactions" >> dotnet.log 2>&1
Then I type fg and the dotnet process comes to the foreground and the log file immediatelly starts filling with output:
$ fg
dotnet test --filter "FullyQualifiedName~GenerateTransactions" >> dotnet.log 2>&1
So how do I make dotnet test detach from the controlling terminal/script ?
you can use nohup command to start you dotnet test
nohup dotnet test --filter "FullyQualifiedName~GenerateTransactions" >> dotnet.log &
OK so I have paramiko v2.2.1 and I am trying to login to a machine and restart a service. Inside the service scripts it basically starts a process via nohup. However if I allow paramiko to disconnect as soon as it is done the process started terminates with a PIPE signal when it writes to stdout.
If I start the service by ssh'ing into the box and manually starting it there is no issue and it runs in the background fine. Also if I add long sleep 10 before disconnecting (close) paramiko it also seems to work just fine.
The service is started via a init.d script via a line like this:
env LD_LIBRARY_PATH=$bin_path nohup $bin_path/ServerLoop.sh \
"$bin_path/Service service args" "$#" &
Where ServerLoop.sh simply calls the service forever in a loop like this so it will never die:
SERVER=$1
shift
ARGS=$#
logger $ARGS
while [ 1 ]; do
$SERVER $ARGS
logger "$SERVER terminated with exit code: $STATUS. Server has been restarted"
sleep 1
done
I have noticed when I start the service by ssh'ing into the box I get a nohup.out file written to the root. However when I run through paramiko I get no nohup.out written anywhere on the system ... ie this after I manually ssh into the box and start the service:
root#ts4700:/mnt/mc.fw/bin# find / -name "nohup*"
/usr/bin/nohup
/usr/share/man/man1/nohup.1.gz
/nohup.out
And this is after I run through paramiko:
root#ts4700:/mnt/mc.fw/bin# find / -name "nohup*"
/usr/bin/nohup
/usr/share/man/man1/nohup.1.gz
As I understand it nohup will only redirect the output to nohup.out if "If standard output is a terminal" (from the manual), otherwise it thinks it is saving the output to a file so it does not redirect. Hence I tried the following:
In [43]: import paramiko
In [44]: paramiko.__version__
Out[44]: '2.2.1'
In [45]: ssh = paramiko.SSHClient()
In [46]: ssh.set_missing_host_key_policy(AutoAddPolicy())
In [47]: ssh.connect(ip, username='root', password=not_for_so_sorry, look_for_keys=False, allow_agent=False)
In [48]: stdin, stdout, stderr = ssh.exec_command("tty")
In [49]: stdout.read()
Out[49]: 'not a tty\n'
So I am thinking that nohup is not redirecting to nohup.out when I run it through paramiko because tty is not returning a terminal. I don't know why adding a sleep(10) would fix this though as the service if run on the command line is quite verbose.
I have also noticed that if the service is started from a manual ssh its tty in the ps ax output is still set to the ssh tty ... however if the process is started by paramiko its tty in the ps ax output is set to "?" .. since both processes are run through nohup I would have expected this to be the same.
If the problem is that nohup is indeed not redirecting the output to nohup.out because of the tty is there a way to force this to happen or a better way to run this sort of command via paramiko?
Thanks all, any help with this would be great :)
I purchased an Asus c300m with the soul aim of developing my linux skills
I followed the instruction to boot in developer mode and execute the following command to start downloading downloading crouton/ubuntu on it
sudo sh -e ~/Downloads/crouton -t xfce
it was going well until my wifi disconnected temporary and i got the following error:
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Failed to complete chroot setup
Unmounting /mtn.stateful_partition/crouton/chroots/precise..
Then I tried to run the sudo command again but I got the following:
/usr/local/chroots/precise already has stuff in it!
Either delete it, specify a different name (-n) or specify -u to update it
However, I'm not sure how to modify the command so i can resume installation or restart it.
You could try sudo sh ~/Downloads/crouton -u -n xfce but it's unlikely that will work. That's from the Crouton docs.
The best approach, since you never finished installing and therefore don't need to recover any data, just delete the install directory and start again. There is no good way for crouton the pick up where it left off.
Also during the install you don't want the Chromebook going to sleep. There is no way in the built-in ChromeOS settings to prevent that but according to this article you can go to the Chrome Web Store and install Keep Awake from Google.
This gives a cool icon in the upper right of the Chrome browser showing a sun, a sunset or a moon depending on what settings you want. Before you start your next install, click it to the sun so the machine won't sleep.
I had the same problem. I ran this and it's downloading:
sudo sh ~/Downloads/crouton -e -t xfce -u
I'm not sure if it's where i left off but it is definitely downloading and reinstalling after the interrupted connection.
Just type in sudo start[desktop environment]
and press y. It should keep going.