Created
December 17, 2013 05:39
-
-
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`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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