Git is not working after macOS update (“xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools”)

The problem is that Xcode Command-line Tools needs to be updated due to OS update. ** UPDATED for Ventura and updated apple dev download page ** After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line … Read more

The best CLI parser for Java [duplicate]

Here are some of the most popular. They are all pretty feature complete, and having used the top two I can recommend them. Commons CLI http://commons.apache.org/cli/ Java Gems http://code.google.com/p/javagems/ picocli (with colorized usage help and autocomplete) http://picocli.info/ JArgs http://jargs.sourceforge.net/ GetOpt http://www.urbanophile.com/arenn/hacking/download.html EDIT: For completeness, here are some others I’ve come across JOpt Simple http://jopt-simple.sourceforge.net/ Args4J … Read more

How to run a specific Android app using Terminal? [duplicate]

Use the cmd activity start-activity (or the alternative am start) command, which is a command-line interface to the ActivityManager. Use am to start activities as shown in this help: $ adb shell am usage: am [start|instrument] am start [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>] [-c <CATEGORY> [-c <CATEGORY>] …] [-e <EXTRA_KEY> <EXTRA_VALUE> [-e <EXTRA_KEY> <EXTRA_VALUE> … Read more

How to create android project with gradle from command line?

Similar to How to create Java gradle project suggest to create Android project with android create project than add build.gradle template for classic Android project gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle. (That would allow to develop in any IDE, as old structure is more widely adopted) Of course there will be some gradle init options or android create (from SDK) … Read more

running a command line containing Pipes and displaying result to STDOUT

Use a subprocess.PIPE, as explained in the subprocess docs section “Replacing shell pipeline”: import subprocess p1 = subprocess.Popen([“cat”, “file.log”], stdout=subprocess.PIPE) p2 = subprocess.Popen([“tail”, “-1”], stdin=p1.stdout, stdout=subprocess.PIPE) p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits. output,err = p2.communicate() Or, using the sh module, piping becomes composition of functions: import sh output = sh.tail(sh.cat(‘file.log’), … Read more

tech