xcode slow to install on simulator and device

2 Solutions Collect From Internet About “xcode slow to install on simulator and device”

My solution for this was to setup a zip file on my Mac, then have the iPhone app detect if the assets were downloaded, if not, grab them from the Mac and unzip. Then the app is slim, and downloads what it needs. This is only for debugging purposes, in the end, you would like to have all the assets installed, so people don’t have to download after they’ve installed. The relevant code looks something like this (no error checking, and you may need to adjust the paths). I’ve been using the excellent ASIHTTP library, and the ZIPArchive project. You’ll need to change your download URL.

  BOOL isDirectory;
  BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:installDirectory  isDirectory:&isDirectory];
  NSLog ( @"Checking for file: %@", installDirectory );
  if ( !fileExists ) {
    NSString* path = [docsPath stringByAppendingString:@"foo.zip"];
    NSLog ( @"Download file!" );
      NSURL *url = [NSURL URLWithString:@""];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request setDownloadDestinationPath:path];    
    [request startSynchronous];

    // Now unzip
    ZipArchive *zipper = [[[ZipArchive alloc] init] autorelease];
    [zipper UnzipOpenFile:path];
    [zipper UnzipFileTo:docsPath overWrite:NO];

    NSFileManager *fileManager = [NSFileManager defaultManager];
    [fileManager removeItemAtPath:path error:NULL];

Xcode apparently supports incremental updates, which is why sometimes “build and go” doesn’t do a complete app update (it’s very annoying).

The easiest thing might be to “install” things into Documents or similar, which is persisted across app updates. Hopefully it moves the files instead of copying.