Windows

Automated Application Wrapping

Automated Application Wrapping

If you are deploying and/or managing Citrix XenMobile Environments one small part of work you have to deal with is the Application Wrapping. If you do have to do this often because of new Application Versions or you have to wrap the Applications for multiple Customers you will be quite quickly annoyed by the Citrix MDX Toolkit GUI. Because of that (and because the GUI does not work on virtualized Macs running on Windows. Why does the GUI need OpenGL?! WindowServer: _CGXGLDisplayContextForDisplayDevice: No matching context for device – disabling OpenGL) i started to use to MDX Toolkit CLI. Since May the MDX Toolkit is very well documented!  XenMobile MDX Toolkit Documentation

But let´s get to the point. I created two little bash scripts for Automated Application Wrapping. One for iOS and one for Android.

 

Android Version:

######################################################################################################
# Purpose:
# Automatically wrap Android Applications for XenMobile
#
# Scriptname:
# Android-wrapping.sh
#
# $ScriptVersion = “0.000.0002
#
# Comments:
#
# Prerequisites:
# – Citrix MDXToolkit
# – Java JDK 1.6 or 1.7
# – Android SDK 19.0.0 or later
# – Valid User Generated Keystore
#
# Author(s):
# Jens Trendelkamp, Jens.Trendelkamp@sepago.de, sepago GmbH
#
# Change history:
# 21.05.2014, Jens Trendelkamp, Jens.Trendelkamp@sepago.de
# – Initial version
# 24.08.2014, Jens Trendelkamp, Jens.Trendelkamp@sepago.de
# – Updated CLI Commands to work with the latest MDX Toolkit
#
#######################################################################################################
#
# KEYSTORE = Keystore Path
# ALIAS = Key Alias
# STOREPASS = Keystore Password
# KEYPASS = Private Key Password
# APKDIR = Path to the unwrapped Android Applications
#######################################################################################################
#!/bin/sh
KEYSTORE=~/Keystore_path/appwrapping.keystore
ALIAS=appwrapping
STOREPASS=password
KEYPASS=password
APKDIR=/User/Jens/APKs

APKS=`ls -r $APKDIR/*.apk`
rm -rf $APKDIR/wrapped && mkdir -p $APKDIR/wrapped

for i in $APKS ; do
bname=`basename -s .apk $i`
java -jar -Xmx1024M /Applications/Citrix/MDXToolkit/ManagedAppUtility.jar wrap \
-in $i \
-keystore $KEYSTORE \
-keyalias $ALIAS \
-keypass $KEYPASS \
-storepass $STOREPASS \
-out $APKDIR/wrapped/$bname.mdx
done

iOS Version:

######################################################################################################
# Purpose:
# Automatically wrap iOS Applications for XenMobile
#
# Scriptname:
# iOS-wrapping.sh
#
# $ScriptVersion = “0.000.0002”
#
# Comments:
#
# Prerequisites:
# – Citrix MDXToolkit
# – Xcode 5.0+
# – Xcode Command Line Tools 
# – Valid Certificate and Provisioning Profile
#
# Author(s):
# Jens Trendelkamp, Jens.Trendelkamp@sepago.de, sepago GmbH
#
# Change history:
# 21.05.2014, Jens Trendelkamp, Jens.Trendelkamp@sepago.de
# – Initial version
# 24.08.2014, Jens Trendelkamp, Jens.Trendelkamp@sepago.de
# – Updated CLI Commands to work with the latest MDX Toolkit
#
#######################################################################################################
#
# CERT = Name of the signing certificate
# PROFILE = Path to the Provisioning Profile
# IPADIR = Path to the unwrapped iOS Applications
#
#######################################################################################################
#!/bin/sh
CERT=”iPhone Distribution: some company”
PROFILE=/Users/Jens/provisioning_profile.mobileprovision
IPADIR=/User/Jens/IPAs

IPAS=`ls -r $IPADIR/*.ipa`
rm -rf $IPADIR/wrapped && mkdir -p $IPADIR/wrapped

for i in $IPAS ; do
bname=`basename -s .ipa $i`
/Applications/Citrix/MDXToolkit/CGAppCLPrepTool Wrap \
-in $i \
-Cert “$CERT” \
-Profile $PROFILE \
-out $IPADIR/wrapped/$bname.mdx
done

 

If you modified the setting and start the script you will see something like this:

App Wrapping OS XOf Course these bash scripts are pretty simple but it´s a good way to start using the MDX Toolkit CLI 🙂

About Jens

My name is Jens Trendelkamp. I currently work as an IT Consultant at sepago GmbH. My fields of specialty are Application Delivery, SBC\VDI Solutions and Enterprise Mobility based on Products from Microsoft and Citrix.

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close