Friday, September 21, 2012

architecture cputype (16777228) cpusubtype (0)

otool -h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o

Output is

/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o (architecture arm64):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedfacf 16777228         0  0x00          1     4        288 0x00002000

/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o (architecture armv7):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedface      12          9  0x00          1     5        532 0x00002000

/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o (architecture armv7s):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedface      12         11   0x00          1     5        532 0x00002000

/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o (architecture armv7f):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedface      12         10  0x00          1     5        532 0x00002000

/SDKs/iPhoneOS7.0.sdk/usr/lib/crt1.o (architecture armv7k):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedface      12         12  0x00          1     5        532 0x00002000




grep CPU.*TYPE_ARM /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/mach/machine.h

Output is

#define CPU_ARCH_ABI64   0x01000000  /* 64 bit ABI */
#define CPU_TYPE_ARM    ((cpu_type_t) 12)
#define CPU_TYPE_ARM64  (CPU_TYPE_ARM | CPU_ARCH_ABI64)   /* 0x0100000C = 16777228 */

#define CPU_SUBTYPE_ARM_ALL   ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_ARM_V6    ((cpu_subtype_t) 6)                     /* armv6 */
#define CPU_SUBTYPE_ARM_V7    ((cpu_subtype_t) 9)              /* (armv7 */
#define CPU_SUBTYPE_ARM_V7F   ((cpu_subtype_t) 10) /* Cortex A9 */
#define CPU_SUBTYPE_ARM_V7S   ((cpu_subtype_t) 11) /* Swift */ /* armv7s */
#define CPU_SUBTYPE_ARM_V7K   ((cpu_subtype_t) 12) /* Kirkwood40 */
#define CPU_SUBTYPE_ARM_V6M   ((cpu_subtype_t) 14) /* Not meant to be run under xnu */
#define CPU_SUBTYPE_ARM_V7M   ((cpu_subtype_t) 15) /* Not meant to be run under xnu */
#define CPU_SUBTYPE_ARM_V7EM  ((cpu_subtype_t) 16) /* Not meant to be run under xnu */
#define CPU_SUBTYPE_ARM_V8    ((cpu_subtype_t) 13)

#define CPU_SUBTYPE_ARM64_ALL           ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_ARM64_V8            ((cpu_subtype_t) 1)



Sunday, June 24, 2012

How to install thoes under Xcode 4.5 (iOS 6)

(1) Installation (note : you have to install Command Line Tools (Mountain Lion) for Xcode 4.5)
if you don't have Command Line Tools use
/Applications/Xcode.app/Contents/Developer/usr/bin/git
install_theos.sh    Select all
# clone theos.git cd ~ git clone git://github.com/DHowett/theos.git # clone iphoneheaders.git cd ~/theos/ mv include include.bak git clone git://github.com/rpetrich/iphoneheaders.git include for FILE in include.bak/*.h; do mv $FILE include/; done rmdir include.bak/ # get IOSurfaceAPI.h cd ~/theos/include/IOSurface/ curl -O -k https://raw.github.com/javacom/toolchain4/master/Projects/IOSurfaceAPI.h # clone theos-nic-templates.git cd ~/theos/templates/ git clone git://github.com/orikad/theos-nic-templates.git # get dpkg-deb for Mac OS X cd ~/theos curl -OL http://test.saurik.com/francis/dpkg-deb-fat chmod a+x dpkg-deb-fat sudo mkdir -p /usr/local/bin sudo mv dpkg-deb-fat /usr/local/bin/dpkg-deb # get ldid for Mac OS X cd ~/theos/bin curl -OL http://dl.dropbox.com/u/3157793/ldid chmod a+x ldid # get libsubstrate.dylib substrate.h cd ~/theos curl -OL http://apt.saurik.com/debs/mobilesubstrate_0.9.4001_iphoneos-arm.deb dpkg-deb -x mobilesubstrate_0.9.4001_iphoneos-arm.deb mobilesubstrate cp mobilesubstrate/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate ~/theos/lib/libsubstrate.dylib cp mobilesubstrate/Library/Frameworks/CydiaSubstrate.framework/Headers/CydiaSubstrate.h include/substrate.h


Download and untar iPhoneOS5.1.sdk.tgz to Xcode
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
tar xzvf ~/Downloads/iPhoneOS5.1.sdk.tgz


(2) get preferenceloader.git for test build
mkdir -p ~/Projects
cd ~/Projects/
git clone git://github.com/DHowett/preferenceloader.git
cd ~/Projects/preferenceloader/



(3) Modify Makefile, change from

include framework/makefiles/common.mk

to

#export TARGET=iphone:latest:2.0
export ARCHS=armv7
include $(THEOS)/makefiles/common.mk
#include framework/makefiles/common.mk


(4) Test build preferenceloader
cd ~/Projects/preferenceloader/
export THEOS=~/theos
make
make package



(5.1) Clone IconRenamer Project
#get CaptainHook headers
cd ~/theos/include/
rm -fr CaptainHook
git clone git://github.com/rpetrich/CaptainHook.git
#get and build IconRenamer
cd ~/Projects
git clone git://github.com/rpetrich/IconRenamer.git
cd ~/Projects/IconRenamer
rmdir framework; ln -sf ~/theos framework

(5.2) Modify Makefile to

export TARGET=iphone:5.1
TWEAK_NAME = IconRenamer
IconRenamer_OBJC_FILES = IconRenamer.m
IconRenamer_FRAMEWORKS = Foundation UIKit

ADDITIONAL_CFLAGS = -std=c99

include $(THEOS)/makefiles/common.mk
include $(THEOS)/makefiles/tweak.mk

(5.3) Build IconRenamer

export THEOS=~/theos
cd ~/Projects/IconRenamer
make
make package


(6) Test build UICatalog
cd ~/Projects
svn co http://apiexplorer.googlecode.com/svn/trunk/UICatalog UICatalog
cd ~/Projects/UICatalog
sed '/^SYSROOT/d' Makefile.theos > Makefile
export THEOS=~/theos
make
make ipa


Please refer to this for the updated iOS7 tweaks http://iphonedevwiki.net/index.php/Updating_extensions_for_iOS_7 .
.
.

Monday, March 5, 2012

Xcode 4.3 command line compile

In case you did't install command line tools


/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -framework Foundation helloworld.m -o helloworld



git command

/Applications/Xcode.app/Contents/Developer/usr/bin/git clone git://github.com/username/project.git


This is for the latest iPhoneOS.sdk using clang

xcrun --sdk iphoneos clang -arch armv7 -framework IOKit -framework CoreFoundation -F /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks -I /Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest/Symbols/usr/include -L /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib -L /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system -Wno-return-type -w -o vmmap vmmap.c


where is PackageMaker?

"Auxiliary tools for Xcode"

.
.
.

Monday, January 30, 2012

Darwin CC Tools odcctools_782-2_iphoneos-arm.deb

Darwin CC Tools, linker and assembler for the iOS.
v782 update
Supports armv6 and armv7

Download here http://apiexplorer.googlecode.com/files/odcctools_782-2_iphoneos-arm.deb
(odcctools_782-2 fixed the missing ld issue)
Instruction to build, see here http://github.com/javacom/toolchain4


The last build was v286 and released in 2008
.
.
.
gdb v1708 for iOS5+

Download here http://apiexplorer.googlecode.com/files/gdb_1708_iphoneos-arm.deb

.
.
.
vim with multi-byte support

Download here http://code.google.com/p/apiexplorer/downloads/detail?name=vim_7.1-4_iphoneos-arm.deb

.
.
.