Coverage file is not getting generated using bullseye with XCode - xcode

I am trying to integrate BullsEye 8.14.0 with Xcode 10.12. Following are the steps that I followed:
mkdir -p $HOME/Library/LaunchAgents
2.Create the file $HOME/Library/LaunchAgents/BullseyeCoverage.plist with contents like below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>BullseyeCoverage</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>COVFILE</string>
<string>path</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Path I have given as $HOME/Desktop/BEC/test123.cov and also tried with Users/myUserName/Desktop/BEC/test123.cov
Add an export command like shown below to the file $HOME/.bash_profile.
export COVFILE=path
Added export PATH=$PATH:/Applications/BullseyeCoverage/bin, in .bash_profile as the first entry.
Then built the xcode project as usual.
Followed the document https://www.bullseye.com/help/tool-xcode.html, in short.
But after doing all this, I should be seeing a test123.cov file generated after the successful build with all the APIs listed, which I couldn"t see.
Am I missing anything?

Related

OSX asdf Launch Daemon Does Not Have Access to Languages

I have a launch daemon plist that runs a python script. The problem is that it is unable to run the script because it does not have access to python.
I am trying to make a launch daemon to change mac address (https://github.com/feross/SpoofMAC)
Here is the plist file in /Library/LaunchDaemons:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>MacSpoof</string>
<key>ProgramArguments</key>
<array>
<string>/Users/username/.asdf/shims/spoof-mac.py</string>
<string>randomize</string>
<string>en0</string>
</array>
<key>StandardOutPath</key>
<string>/Users/username/Projects/MAC/out.log</string>
<key>StandardErrorPath</key>
<string>/Users/username/Projects/MAC/err.log</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
The Error Log reads:
No version is set for command spoof-mac.py
Consider adding one of the following versions in your config file at
python 3.11.1
My tool_version does include Python, how can I make this work?
Okay, I kinda got it working. I moved the plist file from /Library/LaunchDaemons to /Library/LaunchAgents and it works because LaunchAgents run after the user is logged in. It's not exactly what I wanted, but it works.

How do I schedule a launchd task?

I want to run a python script every day at 7pm on a mac-based computer. I put together a script, but I'm not sure where to save it or where I can monitor progress. What can I do to turn this into a task-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.nightlyscript</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/python</string>
<string>/path/to/script.py</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>19</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
According to this excellent article at townrdsdatascience.com, you need to put your property list in the ~/Library/LaunchAgents directory (which you can create in ~/Library if it doesn't already exist. The launchd man page further explains that you can put it in /Library/LaunchAgents if you want it to run for each user on your machine, or in /Library/LaunchDaemons to make it run across the whole system. Be sure to check your plist against the instructions in either of those sources -- I haven't looked to see if you've included everything that's needed. You'll also want to make your python script executable.

Starting Automator Script with LaunchAgent

I built a job by Automator to clear the downloads folder and empty the trash. When i start the created app by double click, it starts correctly. But it has to be transferred to other computer in our company and i dont want to give the user the job to launch the app.
So i created this LaunchAgent script to start the app.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.herpag.aufraeumen.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Users/hansthiele/Applications/Aufraeumen.app</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>45</integer>
<key>Hour</key>
<integer>13</integer>
</dict>
</dict>
</plist>
My problem is now, that the console tells me that the job is started, but nothing happens. The downloads are not cleared and the trash is still full. Also the error.log is empty.
There are 2 issues:
The Label argument must be specified without the .plist extension.
The path must represent the executable rather than the application container. In case of an Automator app the executable is named Application Stub (unlike Applet in an AppleScript app). It's assumed that hansthiele is the real short username of the current user.
Try
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.herpag.aufraeumen</string>
<key>ProgramArguments</key>
<array>
<string>/Users/hansthiele/Applications/Aufraeumen.app/Contents/MacOS/Application Stub</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>45</integer>
<key>Hour</key>
<integer>13</integer>
</dict>
</dict>
</plist>

WatchPaths not working for file added in OSX

I am using MAC OSX 10.6.8.
I would like to apply a script that copy a backup file when I find there is a file named temp.txt.
Here is my plist in /Library/LaunchAgents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lion.backupfile</string>
<key>ProgramArguments</key>
<array>
<string>/Users/lion/q_backup.sh</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Users/lion/temp.txt</string>
</array>
</dict>
</plist>
I find the script only be excuted when file being removed or modified.
How could I excute the script when there is a file exist in the path?
There is no such key in launchd.plist.
WatchPaths will work if any one of the listed paths are modified.
QueueDirectories will run your script whenever there's a file in that directory.

How do I add a file to a TextMate project from the command line?

I'd like to be able to add a file to a Textmate project (which is currently open) from the command line. Is there a way to do it (maybe via Applescript, the mate command, directly editing the project file, etc.)?
Here is a sample TextMate project file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>documents</key>
<array>
<dict>
<key>filename</key>
<string>bar.c</string>
</dict>
<dict>
<key>filename</key>
<string>foo.c</string>
</dict>
<dict>
<key>filename</key>
<string>../src/c/linkedlist.c</string>
</dict>
</array>
<key>fileHierarchyDrawerWidth</key>
<integer>265</integer>
<key>metaData</key>
<dict/>
<key>showFileHierarchyDrawer</key>
<true/>
<key>windowFrame</key>
<string>{{282, 3}, {1148, 875}}</string>
</dict>
</plist>
All you need to do is create a command-line tool which adds the following information:
<dict>
<key>filename</key>
<string>PATH_TO_FILENAME</string>
</dict>
Don't forget to replace PATH_TO_FILENAME with real path. Normally, I would write the script to illustrate my point, but since I don't have time, I can only offer this suggestion instead.

Resources