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

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

Related

zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm

I am following the documentation on creating a Shell script that launches the WebStorm application for a given file folder as described on WebStorm Help page. I am currently using an M1 Pro Macbook (2022) that I just got today and has little else installed beyond Homebrew, VSCode, WebStorm, and PyCharm.
Following the example in the docs, I created a file called webstorm (without any extension) in usr/local/bin and added the following code to it:
#!/bin/sh
open -na "WebStorm.app" --args "$#"
After starting up a new terminal, and running webstorm ., I get the following error in my terminal:
zsh: permission denied: webstorm
I have:
Changed sh to zsh as my default shell is zsh, and that made no difference.
Checked my permissions for both usr/local/bin and usr/local/bin/webstorm to ensure that I have the correct permissions to execute files from here. When right clicking on the webstorm file and clicking "Get Info", I can see that I currently have read and write permissions.
Restarted my computer
To add to my confusion, I have used the same script in the same location on my work Macbook, and it has worked without issues.
Any help on this would be hugely appreciated.
Checked my permissions for both usr/local/bin and usr/local/bin/webstorm to ensure that I have the correct permissions to execute files from here. When right clicking on the webstorm file and clicking "Get Info", I can see that I currently have read and write permissions.
Do you have the "execute" permission?
Try:
$ chmod +x /usr/local/bin/webstorm

Why did my terminal suddenly has darwin13 as host? How do I fix this?

I was trying to install Kaggle but then all of a u sudden I see:
#x86_64-apple-darwin13 on my terminal.
How do I switch this back? I was trying some solutions I found online but every time I run open ~.bash_profile it says:
zsh: no such user or named directory: .bash_profile
Every time turn on terminal, conda will be activated automatically.
Try the following command should work
conda config --set auto_activate_base false

Difficulty getting error when running flutter doctor

It ran smoothly in the beginning, but after a while I get this :
Downloading windows-x64 tools...
Download failed.
URL:
https://storage.googleapis.com/flutter_infra/flutter/1c26bf8c4b55f4fa5f0d175768a1a0cc115c70b2/windows-x64/artifacts.zip
Error: 403 Forbidden"
I have tried to change flutter directory, but it didn't help.
If you are behind a proxy or firewall follow the instructions in these documents
https://flutter.io/community/china
https://www.dartlang.org/tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall
export https_proxy=hostname:port
https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#hot-reload-not-working
export NO_PROXY=127.0.0.1,localhost
I had Same issue and i resolve that with do following tips.
if you are Forced to use proxy for any reason, you need to set proxy true.
to do that, at first run this in terminal:
On Linux/macOS:
export https_proxy=hostname:port
On Windows Command Prompt:
set https_proxy=hostname:port
On Windows PowerShell
$Env:https_proxy="hostname:port"
I am using linux ,
in terminal i ran
export https_proxy=10.32.0.1:8080
// It is my proxy:port
and then ran
flutter run

Flutter commands is not workimg

when I run flutter command as a root user it did not run but it show something like an error
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
Doctor summary (to see all details, run flutter doctor -v):
Dart_NewStringFromUTF8 expects argument 'str' to be valid UTF-8.
I do not understand what I am doing wrong .Kindly help me.
I am trying to run flutter in Kali Linux with android studio installed.
Did I need to run flutter as a non-root user, if yes then I need to install everything for another user . is there any way to do this?
Since you have installed the android studio in your root account.
there is no other option for you.
you have to give a non-root user the permission to use it.
you cant log in the shell alone also.
I recommend you to install only flutter there and use in some text editor an shell commands that's better than as.
kali has some different rules than normal Linux repos.
Run flutter doctor
and do as it suggest

Running ios-sim with Jenkins

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.

Resources