System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
#include <CommonCrypto/CommonDigest.h> | |
unsigned char digest[CC_SHA1_DIGEST_LENGTH]; | |
NSData *stringBytes = [someString dataUsingEncoding: NSUTF8StringEncoding]; /* or some other encoding */ | |
if (CC_SHA1([stringBytes bytes], [stringBytes length], digest)) { | |
/* SHA-1 hash has been calculated and stored in 'digest'. */ | |
... | |
} |
Preparing BerryBoot Images
For people short on SD cards: Berryboot is a simple boot selection screen, allowing you to put multiple Linux distribution on a single SD card. In addition it allows you to put the operating system files on an external USB hard drive instead of on the SD card itself.
#!/bin/sh | |
export CFLAGS="-Os -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -flto" | |
export LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections" | |
./configure \ | |
--disable-cookies \ | |
--disable-crypto-auth \ | |
--disable-dict \ | |
--disable-file \ | |
--disable-ftp \ | |
--disable-gopher \ |
#!/usr/bin/env bash | |
# checck if pidof exists | |
PIDOF="$(which pidof)" | |
# and if not - install it | |
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof | |
# find app in default paths | |
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS |
You also might wanna just use Whisky which does this automatically
This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!
In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.