Macos Shell Script App Wrapper

MacOS 에선 이 스크립트를 사용해서 일단은 App. Xxx.app 이란 디렉토리를 만들고 하부에 적절한 파일들을 생성하면 되지만, 그냥 간단하게 Automator 로 만들어주는 편이 좋다. Sep 30, 2005  The point is that I am using a script which backups all my data, library etc and I need to be logged out. Run the script with sudo or write a wrapper in c, c or so which calls the shutdown command and put the SUID bit on it. Then call the wrapper inn the script. Maybe this would even work with an AppleScript.app, but I have never tested this.

Jun 14, 2019  Unlike CodeWeaver's X server packaged with their CrossOverMac product, Apple's X11.app will not change the screen resolution. So your app must support your monitor's likely huge native resolution, e.g. If your app knows only 800x600. In the wrapper shell script 'launchdinternal' does not call the checkUser function. Also, 'launchd' is MacOS X specific. Why would the 'install' option of the wrapper script detect Ubuntu correctly, but then install a default upstart script that's MacOS X specific? Does anyone have an Ubuntu specific upstart script for the wrapper? Nov 25, 2016  AppleScript’s do shell script is one of its. But could be a useful stopgap until a proper app wrapper is ready. Gatekeeper hard drive High Sierra history history of painting iCloud Impressionism iOS landscape LockRattler log logs Mac Mac history macOS macOS 10.12 macOS 10.13 macOS 10.14 macOS 10.15 malware Metamorphoses. This will run the script when you double-click it. Otherwise, packaging a script in a.app bundle is trivial. Mac OS X will happily run any script identified as the application's executable. You need to have this file structure in place: Wrapper.app Contents Info.plist; MacOS MyScript.

Jul 08, 2020  How to push/send message to iOS and Android in real time. We can use the AWS SNS push notification service to send an alert directly to an application on a mobile device. However, today I am going to use straightforward app service called Pushover.It is a simple app to get real-time notifications on Android, iPhone, iPad, and Desktop, including Android Wear and Apple Watch.

-->

Azure Pipelines | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015

Use this task to build an Android app using Gradle and optionally start the emulator for unit tests.

Deprecated

The Android Build task has been deprecated. Use the Gradle task instead.

Demands

The build agent must have the following capabilities:

  • Android SDK (with the version number you will build against)

  • Android Support Repository (if referenced by Gradle file)

    Arguments

ArgumentDescription
Location of Gradle Wrapper

The location in the repository of the gradlew wrapper used for the build. For agents on Windows (including Microsoft-hosted agents), you must use the gradlew.bat wrapper. Agents on Linux or macOS can use the gradlew shell script.

See The Gradle Wrapper.

Project DirectoryRelative path from the repo root to the root directory of the application (likely where your build.gradle file is).
Gradle Arguments

Provide any options to pass to the Gradle command line. The default value is build

See Gradle command line.

Android Virtual Device (AVD) Options
NameName of the AVD to be started or created.
Note: You must deploy your own agent to use this option. You cannot use a Microsoft-hosted pool if you want to create an AVD.
Create AVD

Select this check box if you would like the AVD to be created if it does not exist.

AVD Target SDKAndroid SDK version the AVD should target. The default value is android-19
AVD Device(Optional) Device pipeline to use. Can be a device index or id. The default value is Nexus 5
AVD ABI

The Application Binary Interface to use for the AVD. The default value is default/armeabi-v7a

See ABI Management.

Overwrite Existing AVDSelect this check box if an existing AVD with the same name should be overwritten.
Create AVD Optional Arguments

Provide any options to pass to the android create avd command.

See Android Command Line.

Emulator Options
Start and Stop Android Emulator

Check if you want the emulator to be started and stopped when Android Build task finishes.

Note: You must deploy your own agent to use this option. You cannot use a Microsoft-hosted pool if you want to use an emulator.
Timeout in SecondsHow long should the build wait for the emulator to start. The default value is 300 seconds.
Headless DisplayCheck if you want to start the emulator with no GUI (headless mode).
Emulator Optional Arguments(Optional) Provide any options to pass to the emulator command. The default value is -no-snapshot-load -no-snapshot-save
Delete AVDCheck if you want the AVD to be deleted upon completion.
Control options

Related tasks

Using Automator.app and Platypus.app, I have been able to bundle a simple shell script I created to power cycle wi-fi on my MacBook Pro. Both resulting apps run properly, but have one glaring issue that I want to correct: The apps reference the shell script from outside of the program. How can I embed the shell script and reference it from the app's resources so that the app can run even if the original source file is moved?

Just to mention it, if you Get Info on a script, you can set it to be opened with the Terminal. This will run the script when you double-click it.

Otherwise, packaging a script in a .app bundle is trivial. Mac OS X will happily run any script identified as the application's executable.

You need to have this file structure in place:

  • Wrapper.app
    • Contents
      • Info.plist
      • MacOS
        • MyScript

Files in italic are actual files, the rest are directory.

Only one entry is required in Info.plist, and it's the one that identifies MyScript as the application's executable:

MyScript can be any script, with execution permissions and the correct shebang. Here's one that uses /bin/sh as the interpreter, but you really could have anything (#!/usr/bin/swift, #!/usr/bin/python, etc).

The script will run as you double-click the app bundle.

You can bundle anything else that you need with your script within the Contents directory. If you feel fancy, you can reproduce the standard executable bundle layout with a Resources directory and things like that.

Login with Facebook option trigger suggest to download an app

android,ios,facebook,osx,login

I found out what I was talking about. Facebook is adding a new feature which ask users if they want to get a link to the mobile app. This is in Beta right now but you will automatically eligible for the feature if: You have integrated the new Facebook Login...

linux - running a process and tailing a file simultaneously

bash,shell,tail

I would simply start the tail in background and the python process in foreground. When the python process finishes you can kill the tail, like this: #!/bin/bash touch /tmp/out # Make sure that the file exists tail -f /tmp/out & pid=$! python test.py kill '$pid' ...

AWK write to new column base on if else of other column

linux,bash,shell,awk,sed

You can use: awk -F, 'NR>1 {$0 = $0 FS (($4 >= 0.7) ? 1 : 0)} 1' test_file.csv ...

CGDisplayCopyAllDisplayModes leaves out one valid mode

osx,swift,core-graphics

There's public API that's only documented in the header. CGDisplayCopyAllDisplayModes() takes an options parameter, which is a dictionary. The docs (and even the headers) say that it's unused and you must past NULL, but you can pass a dictionary with the key kCGDisplayShowDuplicateLowResolutionModes and value kCFBooleanTrue. The option name is...

Run Boot2Docker from bash

osx,bash,docker,boot2docker

Replace your boot2docker start with boot2docker start && $(boot2docker shellinit) and you are good to go. $(boot2docker shellinit) will export all the Environment variables needed.

using sed to replace a line with back slashes in a shell script

regex,bash,shell,ssh,sed

You can use it with ssh and heredoc like this: ssh -t -t [email protected]<<'EOF' sed 's~out_prefix=orderid ^2d+ updatemtnotif/~out_prefix=orderid ^2d+ updatemtnotif_fr/~' ~/path/to/file exit EOF PS: It is important to quote the 'EOF' as shown....

Best Macos Apps

shell script cut from variables

bash,shell,shellcode

With GNU grep: grep -oP 'aaa&K.*' file Output: 123 456 K: ignore everything before pattern matching and ignore pattern itself From man grep: -o, --only-matching Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line. -P, --perl-regexp Interpret PATTERN as a...

Eclipse CDT - No Console Output on OSX

c++,eclipse,osx,terminal,64bit

Are you using the right compiler? If you are compiling with Cross GCC it might not run on a 64bit OS X device. Try using MacOS GCC for compiling if so.

How do I align my output?

I'd rewrite that as: #!/bin/bash while read -ra hello; do name=${hello[8]} if [[ $name '$1'* ]]; then log=${hello[2]} echo '$log $name' fi done | column -t read -ra splits the input line and stores the words in the 'hello' array. [[ $name '$1'* ]] is a built-in way...

Call to implicitly-deleted copy constructor in LLVM(Porting code from windows to mac)

c++,osx,c++11,compiler-errors,llvm

This line of code is very ambiguous: for (auto it : _unhandledFiles)//ERROR HERE auto uses template argument deduction, so std::string s; std::string& sr = sr; auto x = sr; in the above code x is deduced to be of type std::string, not std::string&. So your loop is equivalent to: for...

How to get CPU utilization in % in terminal (mac)

osx,terminal,cpu

This works on a Mac (includes the %): ps -A -o %cpu | awk '{s+=$1} END {print s '%'}' To break this down a bit: ps is the process status tool. Most *nix like operating systems support it. There are a few flags we want to pass to it: -A...

How do you work with views in MainMenu.xib?

objective-c,xcode,osx,cocoa

So the default is that your main application window is an outlet in the app delegate. You should keep MainMenu.xib's owner as the app delegate. A common alternative, if you are creating your own custom window controller, is to create a property in the AppDelegate of type CustomWindowController, then in...

How to uninstall all python versions and use the default system version of OS X 10.10?

python,osx

The file /usr/bin/python (and /usr/bin/pythonw, which is a hard link to the same file) is actually a launcher program that invokes the default version of Python from /System/Library/Frameworks/Python.framework/Versions. You can select the version (2.6 and 2.7 in Yosemite) the launcher invokes using either the defaults command or the VERSIONER_PYTHON_VERSION environment...

Stuck with creating an event and formatting dates (Swift - EventKit - OS X)

ios,osx,swift,eventkit,ekevent

dateString doesn't match the format you specified. Why not use the built-in short style? This appears to work: let dateFormatter = NSDateFormatter() dateFormatter.dateStyle = .ShortStyle var dateString = '07/16/2015' var startDate = dateFormatter.dateFromString(dateString) var endDate = dateFormatter.dateFromString(dateString) startDate and endDate are optionals, so you'll have to unwrap them. In this...

Linux-wget command

linux,shell,wget

Try this to create a string variable n, with no leading whitespace (thanks @011c): n='10.0.0.135.527' wget http://infamvn:8081/nexus/content/groups/LDM_REPO_LIN64/com/infa/com.infa.products.ldm.ingestion.server.scala/'$n'-SNAPSHOT/com.infa.products.ldm.ingestion.server.scala-'$n'-20150622.210643-1-sources.jar ...

Matching string inside file and returning result

regex,string,bash,shell,grep

Using sqlite3 from bash on OS X seems fairly straightforward (I'm no expert at this, by the way). You will need to find out which table you need. You can do this with an interactive session. I'll show you with the database you suggested: /Users/fredbloggs> sqlite3 ~/Library/Application Support/Dock/desktoppicture.db SQLite version...

Initializing a xib view as a subview of another NSView

objective-c,osx,cocoa,xib,nib

You could use the loadNibNamed:owner:topLevelObjects: method. Here's an example: NSArray *views = nil; [[NSBundle mainBundle] loadNibNamed:@'TestView1' owner:nil topLevelObjects:&views]; [self.view addSubview:[views lastObject]]; The above code will load the top-level contents of the XIB into an array. Per the documentation: Load a nib from this bundle with the specified file name and...

How to replace newlines/linebreaks with a single space, but only if they are inside of start/end regexes?

regex,linux,shell,unix,replace

You can do it using awk as: awk '/[x/{f=1} {if(f)printf '%s',$0; else print $0;} /y]/{print '; f=0}' Output: [x data1 data2 data3 data4 y] [a data5 data 6 data7 data 8 b> [x data y] You can also simplify to: awk '/[x/,/y]/{ORS='; if(/y]/) ORS='n';}{print}' Output: [x data1 data2 data3 data4...

ffmpeg: wmv files generated on Mac can't be played in Windows

windows,osx,ffmpeg,file-conversion,wmv

You can try a codec for encoding instead. Try this. ffmpeg -i input_gif -b:v 2M -vcodec msmpeg4 -acodec wmav2 output_wmv You may find this important....

Shell script to loop over files with same names but different extensions

Macos Shell Script App Wrappers

linux,bash,shell

anubhava's solution is excellent if, as they do in your example, the extensions sort into the right order. For the more general case, where sorting cannot be relied upon, we can specify the argument order explicitly: for f in *.ext1 do program '$f' '${f%.ext1}.ext2' done This will work even if...

how to deletes line from a text file that are taken from another file [duplicate]

shell,awk,sed,grep,sh

Something like this with grep: grep -vxf lines.txt data.txt > no_dupplicate_lines.txt Sample: AMD$ cat lines.txt Line2 Line4 AMD$ cat data.txt Line1 Line2 Line3 Line4 Line5 AMD$ grep -vxf lines.txt data.txt Line1 Line3 Line5 Print the lines that are not matching (-v) the exact lines (-x) from the file lines.txt (-f...

ASP.NET vnext overriding status code set in controller. Is this a bug?

osx,asp.net-5,kestrel

The behavior of void returning action was recently changed to not convert to 204 status code. However, for you scenario you could use the CreatedAtRoute helper method(this actually creates a CreatedAtRouteResult) which sets the Location header. [HttpPost] public void Post([FromBody]CrudObject crudObject) { return CreatedAtRoute(routeName: 'GetByIdRoute', routeValues: new { id =...

Use Unix Executable File to Run Shell Script and MPKG File

osx,shell,unix

The most common issue when handling variables containing paths of directories and files is the presence of special characters such as spaces. To handle those correctly, you should always quote the variables, using double quotes. Better code would therefor be: sudo sh '$path/join.sh' sudo sh '$path/join2.sh' It is also advised...

Mac OSX - Allow for user input in shell script via GUI or Prompt

Apps

osx,bash,shell

From what I understand I would recommend you look in to Applescript as this will allow you to have a GUI Interface as well as executing 'SHELL' commands. First of all I would open 'Script Editor' program that comes preinstalled on Mac's This is an example script which asks for...

Why can I view some Unix executable files in Mac OS X and not others?

git,bash,shell,unix,binary

Executable files may be scripts (in which case you can read the text), or binaries (which are ELF formatted machine code). Your shell script is a script; git is an ELF binary. You can use the file command to see more detail. For example, on my nearest Linux system: $...

Change NSTextField border and BG color while editing

osx,swift,cocoa,nstextfield

You can set the delegate of NSTextField: nameTextField.delegate = self then you can set a different state: func control(control: NSControl, textShouldBeginEditing fieldEditor: NSText) -> Bool { nameTextField.bezeled = true nameTextField.backgroundColor = NSColor.textBackgroundColor() return true } func control(control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool { nameTextField.bezeled = false nameTextField.backgroundColor = NSColor.windowBackgroundColor()...

Missing one condition to display a string

The 'grep' command uses a regular expression to match text. Use a '^' before the expression, to match from the start of the line. So, you can change the line name=$(echo $hello | cut -d' ' -f9 | grep $1) to name=$(echo $hello | cut -d' ' -f9 | grep...

oh-my-zsh error after upgrade: ~/.oh-my-zsh/lib/misc.zsh:3: parse error near `then'

shell,zsh,zshrc,oh-my-zsh

Use upgrade_oh_my_zsh upgrade to the latest version. This issue fix here...

Capitalize all files in a directory using Bash

osx,bash,rename

In Bash 4 you can use parameter expansion directly to capitalize every letter in a word (^^) or just the first letter (^). for f in *; do mv -- '$f' '${f^}' done You can use patterns to form more sophisticated case modifications. But for your specific question, aren't you...

Crash when processing `__Atom` class object in Objective C (using Objective C runtime )

objective-c,osx,objective-c-runtime

+[NSObject isSubclassOfClass:] is a class method for NSObject and not all classes are subclasses of NSObject. It seems as if you have find private class that is not a subclass of NSObject, so it requires a more delicate handling for checking for inheritance. Try: BOOL isSubclass(Class child, Class parent) {...

AWK count number of times a term appear with respect to other columns

linux,shell,command-line,awk,sed

Almost same as the other answer, but printing 0 instead of blank. AMD$ awk -F, 'NR>1{a[$2]+=$3;b[$2]++} END{for(i in a)print i, a[i], b[i]}' File pear 1 1 apple 2 3 orange 0 1 peach 0 1 Taking , as field seperator. For all lines except the first, update array a. i.e...

How to extract single-/multiline regex-matching items from an unpredictably formatted file and put each one in a single line into output file?

linux,shell,unix,replace,grep

Assuming that your document is well-formed, i.e. <b> opening tags always match with a </b> closing tag, then this may be what you need: sed '[email protected]<[/]?b>@n&[email protected]' path/to/input.txt | awk 'BEGIN {buf='} /<b>/ {Y=1; buf='} /</b>/ {Y=0; print buf'</b>'} Y {buf = buf$0} ' | tr -s ' ' Output: <b>data1</b>...

Change the “about this” window on mac app

java,osx,deployment

If your application is an .app bundle then it should have an info.plist. Inside the info.plist will normally contain version information that should display the version number: <key>CFBundleShortVersionString</key> <string>2.0.0</string> Typically the version information here is populated in places that call for it (eg. About). To change the name that would...

Calling find more than once on the same folder tree

linux,bash,shell,unix,find

Try this: find . -mmin +35 -or -mmin -25 find supports several logical operators (-and, -or, -not). See the OPERATORS section of the man pages for more details. EDIT: In response to the question about processing the two matches differently, I do not know of a way to do...

OSX tmux configuration session open file in vim automatically

osx,session,vim,configuration-files,tmux

Explicitly inserting a space should do it: send -t 1 vim space ~/Path/to/my/file enter or you can quote command arguments (I prefer this one): send -t 1 'vim ~/Path/to/my/file' 'enter' ...

Identifying when a file is changed- Bash

bash,shell,unix

I would store the output of find, and if non-empty, echo the line break: found=$(find . -name '${myarray[i]}') if [[ -n $found ]]; then { echo '$found'; echo '<br>'; } >> '$tmp' fi ...

Read plist inside ~/Library/Preferences/

objective-c,xcode,osx

You need to use NSString method: stringByExpandingTildeInPath to expand the ~ into the full path. NSString *resPath = [@'~/Library/Preferences/' stringByExpandingTildeInPath]; NSLog(@'resPath: %@', resPath); Output: resPath: /Volumes/User/me/Library/Preferences ...

How to get NSTableView to use a custom cell view mixed with preset cell views?

osx,swift,cocoa,nstableview,nstableviewcell

I'd try just giving the default cell your own identifier in Interface Builder... ...then just use that in conjunction with makeViewWithIdentifier:: func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? { var viewIdentifier = 'StandardTableCellView' if let column = tableColumn { switch column.identifier { case 'nameColumn': viewIdentifier = 'nameCellView'...

How to display Apple San Francisco's numbers mono-spaced rather than proportionally?

osx,fonts,apple

Number formatting of an OpenType font requires having control over which features are active during text shaping, something which typesetting tools will offer (InDesign, XeLaTeX, etc), but which normal productivity tools still (after a decade of Adobe, Apple, and Microsoft all agreeing on using OpenType!) don't offer. Notes included. So,...

Using the shell provided with NodeJS

javascript,node.js,shell,require,node-modules

As per issue #5431, looks like the Node.JS REPL doesn't find globally-installed modules and this is expected behaviour. In the article linked from that issue, it reads: If you’re installing something that you want to use in your program, using require('whatever'), then install it locally, at the root of your...

How to extract first letters of dashed separated words in a bash variable?

Macos Shell Script

linux,string,bash,shell,variables

This isn't the shortest method, but it doesn't require any external processes. IFS=- read -a words <<< $MY_TEXT for word in '${words[@]}'; do MY_INITIALS+=${word:0:1}; done ...

pcap_dispatch() always returns 0 on Mac OSX for wifi interface

osx,pcap,libpcap,arp

If you are capturing in monitor mode, you will be getting native 802.11 packets, which do not look like Ethernet packets, so filtering similarly to Ethernet will not work. Furthermore, if you're capturing in monitor mode on a protected network, i.e. a network using WEP or WPA/WPA2, everything past the...

How do I silence the HEAD of a curl request while using the silent flag?

bash,shell,curl,command-line,pipe

Try this: curl --silent 'www.site.com' > file.txt ...

Display django runserver output from Vagrant guest VM in host Mac notifications?

python,django,osx,notifications,vagrant

Why not run a SSH server on the VM and connect from the host via a terminal? See MAC SSH. Which OS is running on the VM? It should not be too hard to get the SSH server installed and running. Of course the VM client OS must have an...

How to programatically make a key shortcut?

osx,bash,task-switching

You can use Applescript to achieve this. To focus on a specific application: tell application 'Finder' to activate And to emulate an actual Cmd+Tab input: tell application 'System Events' key down command keystroke tab key up command end tell Applescript files (*.scpt) can be run through the command line with...

Multiple line search in a file using java or unix command

java,shell,unix,command

You can find like this. File file = new File('data/pattern.txt'); Pattern pat = Pattern.compile('subclass 'Pool1' 11:22:33:44:55:66 {s*dynamic;s*}'); String content = Files.lines(file.toPath()).collect(Collectors.joining('n')); Matcher m = pat.matcher(content); while (m.find()) { System.out.printf('found at %d-%d%n', m.start(), m.end()); } ...

Macos Bash Script

How to test if a command is a shell reserved word?

bash,shell

#!/bin/bash string=$1 if [[ $(type '$string' 2>&1) '$string is a shell'* ]]; then echo 'Keyword $string is reserved by shell' fi ...

Delete some lines from text using Linux command

linux,shell,sed,grep,pattern-matching

The -v option to grep inverts the search, reporting only the lines that don't match the pattern. Since you know how to use grep to find the lines to be deleted, using grep -v and the same pattern will give you all the lines to be kept. You can write...