Skip to content

Instantly share code, notes, and snippets.

@karlin
Created December 17, 2013 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlin/8000543 to your computer and use it in GitHub Desktop.
Save karlin/8000543 to your computer and use it in GitHub Desktop.
A simple script to create a web server in the current directory that allows iOS devices to install apps for in-house distribution. Invoke with a port and IP, like `python in_house_dist_server.py 8000 192.168.1.2`
import SimpleHTTPServer, BaseHTTPServer, sys
class InHouseRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map['.plist'] = 'text/xml'
def do_GET(self):
if self.path == "/index.html":
self.wfile.write('<p><a href="itms-services://?action=download-manifest&url=http://'+sys.argv[2]+':'+sys.argv[1]+'/manifest.plist">Install App</a></p>')
self.send_response(200)
return
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
BaseHTTPServer.test(InHouseRequestHandler, BaseHTTPServer.HTTPServer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment