Sunday, September 14, 2008

Copy iPhone SDK headers from Mac to iPhone

Use this shell script in Mac Terminal to copy the installed SDK header files (firmware 2.1) to iPhone , if you have installed the iPhone SDK (build 9M2517) for (2.0 & 2.1 development)
directly and you have to change IPHONEIP for your actual iPhone IP address

copySDKHeaders2.sh : Select all

#!/bin/sh
IPHONEIP=10.0.2.2
#SDKVER=2.0
#SDKVER=2.1
SDKVER=2.2
sdkroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/System/Library/Frameworks
sdkframeworks[1]=$sdkroot/AddressBook.framework/Headers/*
sdkframeworks[2]=$sdkroot/AddressBookUI.framework/Headers/*
sdkframeworks[3]=$sdkroot/AudioToolbox.framework/Headers/*
sdkframeworks[4]=$sdkroot/AudioUnit.framework/Headers/*
sdkframeworks[5]=$sdkroot/CFNetwork.framework/Headers/*
sdkframeworks[6]=$sdkroot/CoreAudio.framework/Headers/*
sdkframeworks[7]=$sdkroot/CoreFoundation.framework/Headers/*
sdkframeworks[8]=$sdkroot/CoreGraphics.framework/Headers/*
sdkframeworks[9]=$sdkroot/CoreLocation.framework/Headers/*
sdkframeworks[10]=$sdkroot/Foundation.framework/Headers/*
sdkframeworks[11]=$sdkroot/MediaPlayer.framework/Headers/*
sdkframeworks[12]=$sdkroot/OpenAL.framework/Headers/*
sdkframeworks[13]=$sdkroot/OpenGLES.framework/Headers/*
sdkframeworks[14]=$sdkroot/QuartzCore.framework/Headers/*
sdkframeworks[15]=$sdkroot/Security.framework/Headers/*
sdkframeworks[16]=$sdkroot/SystemConfiguration.framework/Headers/*
sdkframeworks[17]=$sdkroot/UIKit.framework/Headers/*
sdkframeworks[18]=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDKVER}.sdk/System/Library/Frameworks/IOKit.framework/Headers/*
iphonesdkroot=/var/sdk
iphoneframeworksroot=$iphonesdkroot/include
iphoneframeworks[1]=$iphoneframeworksroot/AddressBook/
iphoneframeworks[2]=$iphoneframeworksroot/AddressBookUI/
iphoneframeworks[3]=$iphoneframeworksroot/AudioToolbox/
iphoneframeworks[4]=$iphoneframeworksroot/AudioUnit/
iphoneframeworks[5]=$iphoneframeworksroot/CFNetwork/
iphoneframeworks[6]=$iphoneframeworksroot/CoreAudio/
iphoneframeworks[7]=$iphoneframeworksroot/CoreFoundation/
iphoneframeworks[8]=$iphoneframeworksroot/CoreGraphics/
iphoneframeworks[9]=$iphoneframeworksroot/CoreLocation/
iphoneframeworks[10]=$iphoneframeworksroot/Foundation/
iphoneframeworks[11]=$iphoneframeworksroot/MediaPlayer/
iphoneframeworks[12]=$iphoneframeworksroot/OpenAL/
iphoneframeworks[13]=$iphoneframeworksroot/OpenGLES/
iphoneframeworks[14]=$iphoneframeworksroot/QuartzCore/
iphoneframeworks[15]=$iphoneframeworksroot/Security/
iphoneframeworks[16]=$iphoneframeworksroot/SystemConfiguration/
iphoneframeworks[17]=$iphoneframeworksroot/UIKit/
iphoneframeworks[18]=$iphoneframeworksroot/IOKit/

ssh root@$IPHONEIP "mkdir -p $iphoneframeworksroot"
scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/include root@$IPHONEIP:$iphonesdkroot
scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/lib root@$IPHONEIP:$iphonesdkroot

for index in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
do
echo "copying ${sdkframeworks[index]} to ${iphoneframeworks[index]}"
ssh root@$IPHONEIP "mkdir -p ${iphoneframeworks[index]}"
scp -r ${sdkframeworks[index]} root@$IPHONEIP:${iphoneframeworks[index]}
done


This is for SDK 3.0 header files to iPhone

copySDKHeaders3.sh : Select all

#!/bin/sh
IPHONEIP=10.0.2.2
SDKVER=3.0
sdkroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/System/Library/Frameworks
sdkframeworks[1]=$sdkroot/AVFoundation.framework/Headers/*
sdkframeworks[2]=$sdkroot/AddressBook.framework/Headers/*
sdkframeworks[3]=$sdkroot/AddressBookUI.framework/Headers/*
sdkframeworks[4]=$sdkroot/AudioToolbox.framework/Headers/*
sdkframeworks[5]=$sdkroot/AudioUnit.framework/Headers/*
sdkframeworks[6]=$sdkroot/CFNetwork.framework/Headers/*
sdkframeworks[7]=$sdkroot/CoreAudio.framework/Headers/*
sdkframeworks[8]=$sdkroot/CoreData.framework/Headers/*
sdkframeworks[9]=$sdkroot/CoreFoundation.framework/Headers/*
sdkframeworks[10]=$sdkroot/CoreGraphics.framework/Headers/*
sdkframeworks[11]=$sdkroot/CoreLocation.framework/Headers/*
sdkframeworks[12]=$sdkroot/ExternalAccessory.framework/Headers/*
sdkframeworks[13]=$sdkroot/Foundation.framework/Headers/*
sdkframeworks[14]=$sdkroot/GameKit.framework/Headers/*
sdkframeworks[15]=$sdkroot/MapKit.framework/Headers/*
sdkframeworks[16]=$sdkroot/MediaPlayer.framework/Headers/*
sdkframeworks[17]=$sdkroot/MessageUI.framework/Headers/*
sdkframeworks[18]=$sdkroot/MobileCoreServices.framework/Headers/*
sdkframeworks[19]=$sdkroot/OpenAL.framework/Headers/*
sdkframeworks[20]=$sdkroot/OpenGLES.framework/Headers/*
sdkframeworks[21]=$sdkroot/QuartzCore.framework/Headers/*
sdkframeworks[22]=$sdkroot/Security.framework/Headers/*
sdkframeworks[23]=$sdkroot/StoreKit.framework/Headers/*
sdkframeworks[24]=$sdkroot/SystemConfiguration.framework/Headers/*
sdkframeworks[25]=$sdkroot/UIKit.framework/Headers/*
sdkframeworks[26]=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDKVER}.sdk/System/Library/Frameworks/IOKit.framework/Headers/*
iphonesdkroot=/var/sdk
iphoneframeworksroot=$iphonesdkroot/include
iphoneframeworks[1]=$iphoneframeworksroot/AVFoundation/
iphoneframeworks[2]=$iphoneframeworksroot/AddressBook/
iphoneframeworks[3]=$iphoneframeworksroot/AddressBookUI/
iphoneframeworks[4]=$iphoneframeworksroot/AudioToolbox/
iphoneframeworks[5]=$iphoneframeworksroot/AudioUnit/
iphoneframeworks[6]=$iphoneframeworksroot/CFNetwork/
iphoneframeworks[7]=$iphoneframeworksroot/CoreAudio/
iphoneframeworks[8]=$iphoneframeworksroot/CoreData/
iphoneframeworks[9]=$iphoneframeworksroot/CoreFoundation/
iphoneframeworks[10]=$iphoneframeworksroot/CoreGraphics/
iphoneframeworks[11]=$iphoneframeworksroot/CoreLocation/
iphoneframeworks[12]=$iphoneframeworksroot/ExternalAccessory/
iphoneframeworks[13]=$iphoneframeworksroot/Foundation/
iphoneframeworks[14]=$iphoneframeworksroot/GameKit/
iphoneframeworks[15]=$iphoneframeworksroot/MapKit/
iphoneframeworks[16]=$iphoneframeworksroot/MediaPlayer/
iphoneframeworks[17]=$iphoneframeworksroot/MessageUI/
iphoneframeworks[18]=$iphoneframeworksroot/MobileCoreServices/
iphoneframeworks[19]=$iphoneframeworksroot/OpenAL/
iphoneframeworks[20]=$iphoneframeworksroot/OpenGLES/
iphoneframeworks[21]=$iphoneframeworksroot/QuartzCore/
iphoneframeworks[22]=$iphoneframeworksroot/Security/
iphoneframeworks[23]=$iphoneframeworksroot/StoreKit/
iphoneframeworks[24]=$iphoneframeworksroot/SystemConfiguration/
iphoneframeworks[25]=$iphoneframeworksroot/UIKit/
iphoneframeworks[26]=$iphoneframeworksroot/IOKit/

ssh root@$IPHONEIP "mkdir -p $iphoneframeworksroot"
scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/include root@$IPHONEIP:$iphonesdkroot
scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/lib root@$IPHONEIP:$iphonesdkroot

for index in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
do
echo "copying ${sdkframeworks[index]} to ${iphoneframeworks[index]}"
ssh root@$IPHONEIP "mkdir -p ${iphoneframeworks[index]}"
scp -r ${sdkframeworks[index]} root@$IPHONEIP:${iphoneframeworks[index]}
done

.
.
.

No comments: