Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode project #268

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Xcode project #268

wants to merge 2 commits into from

Conversation

Easen
Copy link
Contributor

@Easen Easen commented Jun 1, 2011

Hi Peter,

How are you?

Once again I've been a bit busy, I managed to create a XCode project for MobileNotifier and hooked in the build and clean functions. I'm guessing that you code in vim, I'm familiar with vim but I prefer to use XCode for iPhone projects this is why I created the XCode project. Please have a look and let me know what you think.

Cheers,
Marc

@timnovinger
Copy link
Collaborator

Thanks for doing this @Easen! What is the purpose of the make-wrapper.sh file btw?

@Easen
Copy link
Contributor Author

Easen commented Jun 1, 2011

I should have explained...
XCode 4.0 doesn't allow you to include the 3 needed shell environment variables, if you tick use 'Building settings in Environment' in XCode it will include all load of predefined compiler and linker flags which conflict with theos. This is where make-wrapper.sh comes in, instead of running the native /usr/bin/make in XCode I've configured to use this wrapper, which sets the required environment variables without XCode injecting a load of rubbish and then executes /usr/bin/make.

It's a bit hacky I know, but until XCode fixes this bug (which I think they wont) this is the only way I found to get around this issue.

@timnovinger
Copy link
Collaborator

Ahh I see now. So that handles building the project, but to package it up and install it you would still have to run make package install from the terminal.

Which coincidentally makes the project....so I guess my next question is, is there a way to hook into Xcode's native "Build and Run"?

Being an optional workflow for building the project, even though incomplete, it doesn't look like there's much harm in using Xcode in this fashion.

@Easen
Copy link
Contributor Author

Easen commented Jun 1, 2011

I don't know about the "Build and Run" option, I think you can't because it's an external target.

However in XCode 4 you could create a new target based on the target I've already created and set the arguments to package install. The only thing I can see which would be missing from this workflow would be the IP address of the iPhone device export THEOS_DEVICE_IP=192.168.x.x, which would have to be set in the make-wrapper.sh

@timnovinger
Copy link
Collaborator

I've had good luck using THEOS_DEVICE_IP=iphone-4.local as I named my phone "iPhone 4" in iTunes.

Really original I know.

@peterhajas
Copy link
Owner

Really really great work Marc!

We should definitely look into grabbing the Build & Run and deploying the packaged to the device...

@timnovinger
Copy link
Collaborator

This works better if you set a shell variable of MNProjectRoot for your project filepath. The first error I encountered when setting this up was that it couldn't find your system's filepath :)

I also think it's a better idea to not include the shell variable for the SDK version. I'm running 4.3 but you were running 4.2. We already have it set in the readme that the developer needs to add these for themselves so redeclaring them in make-wrapper.sh causes conflicts. Coincidentally the other shell vars set are ok as those should never change.

@timnovinger
Copy link
Collaborator

Actually I take it back, you're right....those variables HAVE to be set in that script. Drats.

@oscahie
Copy link

oscahie commented Jul 21, 2011

The "Directory" field may actually be left empty, that way Xcode will use the actual project folder by default.

Also in order to be able to run make package you might have to add the following for make to be able to invoke dpkg:

export PATH=$PATH:/opt/local/bin

In my case I've linked the "Build" action to make package install and "Clean" to make clean:

if [ "$ACTION" == "clean" ]
then
/usr/bin/make clean
else
/usr/bin/make package install
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants