It's often convenient to run jcmd command programmatically from within a testcase to get some information or to adjust options.
See the template below:
// import javax.management.ObjectName;
// import javax.management.MBeanServer;
public static void reloadCompilerDirectives(String filename) {
String result;
result = doRunDcmd("compilerDirectivesClear", new String[]{""});
result = doRunDcmd("compilerDirectivesAdd", new String[]{ filename });
}
private static String doRunDcmd(String operationName, String operationArgs[]) {
ObjectName objectName =
new ObjectName("com.sun.management:type=DiagnosticCommand");
MBeanServer mbeanServer =
ManagementFactory.getPlatformMBeanServer();
Object[] params = new Object[] { operationArgs };
String[] signature = new String[]{ String[].class.getName() };
return(String) mbeanServer.invoke(objectName, operationName, params, signature);
}
- Details
- Hits: 271
xip is an old archive format used to distribute XCode. it's actually an xar format but with ability to be signed. If you installing the same software multiple times and don't want to spend time to verify known to be valid signature, instead of xip -x do the following (you can use xar -x -f instead of bsdtar xvf):
bsdtar xvf Archive.xip
ditto -x Content .
- Details
- Hits: 506
Page 2 of 8