Running ios-sim with Jenkins - shell

I'm trying to start my app from the command line using ios-sim but this is what I get:
Started by user User
Building in workspace /Users/Shared/Jenkins/Home/jobs/UI Testing/workspace
[workspace] $ /bin/sh -xe /var/folders/h4/ws64t3bx2nnds4pg3345xrr000009c/T/hudson6341279754557259451.sh
+ /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app
[DEBUG] Could not start simulator session: Error Domain=DTiPhoneSimulatorErrorDomain Code=5
"Operation failed with underlying error 4294956486." UserInfo=0x1001b1760
{NSLocalizedDescription=Operation failed with underlying error 4294956486.,
NSUnderlyingError=0x1001a3390 "The operation couldn’t be completed. (OSStatus error -10810.)"}
It looks like a permission problem as I can run the same command from terminal and it works fine. I've also tried to give full 777 permission to ios-sim and the MonkeyTalk directory,but still nothing.
Any idea?

It might be related to the Jenkins process not having a "display". Try running Jenkins as a user logged in to the desktop, then run the ios-sim again.
Unload Jenkins from launchd:
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Then run Jenkins from a terminal:
sudo su jenkins -c "JENKINS_HOME=/Users/Shared/Jenkins/Home /Library/Application\ Support/Jenkins/jenkins-runner.sh"
If this works, you can make Jenkins always run as a logged in user by moving the launchd job config file from /Library/LaunchDaemons/org.jenkins-ci.plist to ~/Library/LaunchAgents/org.jenkins-ci.plist

I know this post was from a while ago, and not sure if anyone is checking it, but I also ran into this issue recently and it turned out that there was a duplicate app already in the iphone simulator creating an issue and not letting the new app run.
I reset the simulator and it then worked. I then added the applescript to reset the simulator each time before running ios-sim. this script can be found here...
How can I reset the iOS Simulator from the command line?
Scroll down the answer that has 13 up votes next to it, not the one that was checked marked.
Hope this helps someone in the future..

It looks like the only workaround it's to run the command as super user:
sudo /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app

I was also facing the same problem and found that jenkins user is not correctly set up to run test case on simulator. Follow instruction given on below website:
http://pivotallabs.com/ios-ci-jenkins/
see the section "SETTING UP THE JENKINS USER".
hope it will work for you as well.

Related

Trying to set up PSQL and i get this error :

I am trying to start a Spring project using a PSQL database.
I have installed PSQL using Homebrew but,
When i run :
brew services start postgresql
I get this error:
Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/[myusername]/Library/LaunchAgents/homebrew.mxcl.postgresql.plist exited with 5.
I am following this tutorial:
https://medium.com/#viviennediegoencarnacion/getting-started-with-postgresql-on-mac-e6a5f48ee399
Using a mac which is up to date.
Any help is greatly appreciated!
So my postgres service was started apparently.
Therefore when i was trying to start it again it causes an error.
Fix was to stop it and re run.
This error is due to the fact the server is already running. We need to stop and start it.
For Mac Users:
brew services stop postgresql
brew services start postgresql
EDIT: This may be a track, but it doesn't happen for me again since I updated to Monterey and running PSQL13
A full computer restart did solve it for me.
PS: I think the problem is related to the checkbox on log off "Reopen windows when logging back in".

Jenkins pipeline fails with error : "docker : permission deinied"

I'm trying to run my react & nodeJs project on jenkins with docker, to create CI/CD ability. at the moment I just want to make sure it works in the most simple way.
I had an error on the same location at the pipeline with message : "docker:not found"
I've solved it using "-v $(which docker):/usr/bin/docker" when starting jenkins.
Now - I understand I need permission for jenkins to use docker, and I found this terminal command line that should solve it: "usermod -G docker -a jenkins" and I get an error (on a Mac) : "zsh: command not found: usermod"
any help would be appreciated, to modify or replace this line, or another idea that might work. thanks !
Mac does not come with the passwd package that contains usermod. An alternative to managing user groups is described here. usermod equivalent in OSX

Jenkins with flutter 'flutter clean' is showing 'Operation not permitted'

I was trying to do CI with Jenkins for Flutter project on MAC.
I have added the environment variables for HOME, ANDROID_HOME and PATH. But, flutter commands are not working. They are showing 'Operation not permitted'.
This is exact error:
bash: /Users/mdhasnain/Documents/flutter/bin/flutter: Operation not permitted
What I have tried so far:
1. Changed admin user's sudo command NOPASSWD and tried flutter command with sudo.
2. Tried to change flutter file's permission in flutter/bin folder: chmod a+x+w+r /Users/username/Documents/flutter/bin/flutter
3. Also tried to change the permission manually.
N.B. flutters commands are working fine from terminal.
I am stuck. Advance thanks for your help.
You need to grant Java with Full Disk Access privileges.
Please see: https://stackoverflow.com/a/62678687/1844385

What is causing this project to fail on Macbook Pro when It runs just fine on windows 10

I have a nativescript application in windows that deploys to the emulator just fine, but when I git clone onto the MacBook Pro and run the same process, I get:
new-host:nativescript jbaird$ tns run android
Searching for devices...
Starting Android emulator with image Nexus_5X_API_26
Waiting for emulator device initialization...
Executing before-liveSync hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Preparing project...
Project successfully prepared (Android)
Building project...
Unable to apply changes on device: emulator-5554. Error is: spawn EACCES.
Executing after-watch hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/after-watch/nativescript-dev-typescript.js
Any ideas? Thanks in advance.
The error is a permission error. Therefore, all you need to do is give access to the the folder you are running your apps from. The process involves you to copy and paste the command below into your terminal.
sudo chmod -R a+rwx /AppFolder
The command is an administrator command, therefore, you may have to insert your system password.
PS: Definitely, you hit enter and there will be a prompt for you to insert your password.
Let me know if you have any challenges with this solution!
emulator-5554. Error is: spawn EACCES.emulator-5554. Error is: spawn EACCES.
Seems a permission error. You could solve it by:
sudo,
Or, by giving +x permision to your hooks folder?

Got "filename.settings cannot be locked because it is read-only" error running iReport 4.0.2 at Ubuntu

I just installed iReport yesterday and it was working fine. But when I try to run it today it is not working properly.
Here is what I have done;
Downloaded iReport-4.0.2
Extracted it in my downloads folder
Try running though terminal
adm#linux:~/Downloads/iReport-4.0.2/bin$ sudo ./ireport
this gives the No protocol specified error in terminal.
adm#linux:~/Downloads/iReport-4.0.2/bin$ ./ireport
without sudo, this show many error messages in terminal and starts iReport. But again shows popup several errors. Still I cannot create or edit reports.
Here are the errors. I can post the output in terminal if needed. But its quite lengthy.
I also tried moving the iReport-4.0.2 to the /opt/ folder. Even that resulted the same thing.
Also my JasperServer is up and running. But when I run a report it returns the following error;
com.jaspersoft.jasperserver.api.JSException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
Do not know whether there is any connection between these two issues.
$ sudo chmod 775 -R iReport-4.0.2/
if don't work you should use "sudo" to open iReport
$ sudo ./ireport
Regards
Yusuf Firdaus
you must login with root user in terminal means
$ sudo su
Enter password
After that run the ireport

Resources