Theos/Setup: Difference between revisions

From iPhone Development Wiki
(→‎For iOS: more verbosity on SDKs)
(Undo revision 5753 by Kritanta (talk))
Tags: Replaced Undo
 
(114 intermediate revisions by 22 users not shown)
Line 1: Line 1:
== Purpose ==
{{soft redirect|https://theos.dev/install}}


This page contains instructions for installing [[Theos]] and preparing a new project.
This article is obsolete, and has been replaced by the [https://theos.dev/install theos.dev website].


== Requirements ==
If you need historical installation instructions, you can find the last version of this article [https://iphonedev.wiki/index.php?title=Theos/Setup&oldid=5735 here].
 
* A modern operating system (Windows (using Cygwin), Mac OS X, iOS (jailbroken), and most variants of Linux should do)
** curl
** git
** make
** openssh
** perl
** python (if on Windows)
** rsync
* Some form of a toolchain or official SDK
* Access to a terminal emulator and some knowledge of how to use it
* '''Objective-C knowledge'''
 
More detailed explanations of these requirements are given in the next section, and are dependent on the environment you use.
 
== Setting Up Dependencies ==
 
=== For Mac OS X ===
 
Mac OS X comes with most of the necessary tools (subversion, curl, and perl) by default.
You will still need compilation tools and the iOS SDK, and the easiest way to obtain both of these is by installing the official [http://developer.apple.com/iphone/ iOS SDK] from Apple's web site. (You will have to register for a free developer account in order to download it.)
 
=== For iOS ===
 
* Install the SDK.
As of version 0.9.523 Theos accepts multiple SDKs to be placed in <code>$THEOS/sdks</code>. Folders here should have a name like <code>iPhone7.0.sdk</code>.
 
One can get an SDK from an Apple computer with Xcode installed, ''or from XCode's dmg image (not sure about this)''.
 
If no SDKs are provided, the following error will be displayed: <code>".../theos/makefiles/targets/darwin-arm/iphone.mk:21: *** first argument to 'word' function must be greater than 0. stop."</code>
 
=== For Linux ===
 
Like OS X, most distributions come pre-packaged with the aforementioned tools. On Debian-based distros, APT can be used to install the tools like so:
<pre>sudo apt-get install git perl curl</pre>
 
If your distro uses RPM, the process is very similar. As for the SDK, it can be downloaded from Apple's web site, as mentioned above.
 
== Installing Theos ==
 
=== On Mac OS X or Linux ===
 
# Open a terminal window.
# Choose a location for Theos to be installed. If you are unsure, a good choice is <tt>/opt/theos</tt>.<pre>export THEOS=/opt/theos</pre>
#* If you chose a location outside of your user's home directory, you will probably need to run some or all of the following commands with root permissions.
# Download the latest version of Theos:
#* Using git: <pre>git clone git://github.com/DHowett/theos.git $THEOS</pre>
#* Alternatively, you can use svn, if you prefer: <pre>svn co http://svn.howett.net/svn/theos/trunk $THEOS</pre>
# Download <tt>[[ldid]]</tt> to <tt>$THEOS/bin</tt>: <pre>git clone git://git.saurik.com/ldid.git&#10;cd ldid&#10;git submodule update --init&#10;./make.sh&#10;cp -f ./ldid $THEOS/bin/ldid</pre>
 
=== On iOS ===
 
(On your iOS device:)
 
# Create a file at <tt>/etc/apt/sources.list.d/coredev.nl.list</tt> containing the following line: <pre>deb http://coredev.nl/cydia iphone main</pre>
# Create a file at <tt>/etc/apt/sources.list.d/howett.net.list</tt> containing the following line: <pre>deb http://nix.howett.net/theos ./</pre>
# Make sure APT 0.6 Transitional Package is installed before doing this step.As root, issue these commands (using either SSH or MobileTerminal): <pre>apt-get update</pre><pre>apt-get install perl net.howett.theos</pre>
 
'''Note:''' Theos will be installed to <tt>/var/theos/</tt> on your device, hereafter referred to as <tt>$THEOS</tt> in this guide.
 
== Creating a Project ==
 
Theos lets you create new projects based on templates using the New Instance Creator (NIC).  You do not need to be root to do this step, nor should you be.  Start the NIC wizard using the following command:
 
$THEOS/bin/nic.pl
 
NIC will prompt you for all the necessary information before creating a project.
 
=== NIC Example ===
 
Here is an example of what you will see when using the NIC to create a project (with user input shown in bold):
 
$ '''$THEOS/bin/nic.pl'''
NIC 1.0 - New Instance Creator
------------------------------
  [1.] iphone/application
  [2.] iphone/library
  [3.] iphone/preference_bundle
  [4.] iphone/tool
  [5.] iphone/tweak
Choose a Template (required): '''1'''
Project Name (required): '''iPhoneDevWiki'''
Package Name [com.yourcompany.iphonedevwiki]: '''net.howett.iphonedevwiki'''
Authour/Maintainer Name [Dustin L. Howett]:             
Instantiating iphone/application in iphonedevwiki/...
Done.
$
 
The above will create a folder <tt>./iphonedevwiki</tt> in the current working directory - make sure you have permissions to create a folder.
 
==Making your Project==
 
When you have finished developing your tweak/app, you may want to distribute it, either to your own device, or to an external source.
 
Before you do, add Theos environment variables to your <code>.bash_profile</code> (or the equivalent for your shell). Open <code>.bash_profile</code> (which is in your home directory) in your favorite editor and add this on the last line, replacing the device name with your own device's name (replacing spaces with dashes) or its IP address: <!-- this bit of text is borrowed from http://sharedinstance.net/2013/12/build-on-windows/ with permission, thanks kirb! -->
 
<source lang="bash">
export THEOS=/opt/theos
export THEOS_DEVICE_IP=example.local THEOS_DEVICE_PORT=22
</source>
 
(To get your device's IP address, go to settings, Wi-Fi, then press the '''i''' on the network you are currently connected on, and then see where it says IP Address. This is what you type in, if you don't want to use a device name.)
 
Load this into the shell with <code>. ~/.bash_profile</code>, or close the terminal window and launch a new one.
 
When you are making the project, type this in the terminal, in your project folder:
 
$ make package install
 
This will generate a .deb file, which you can distribute to people or to repositories. It will then ask for your root password and install the .deb onto your device. If you haven't changed your root password, the default password is '''alpine'''. Make sure you change your root password, which you can do with '''passwd''' (see "Root Password How-To" on the Cydia homepage for detailed instructions).
 
If you just want to make a package, type:
 
$ make package
 
==Getting Started==
You can learn how to do Makefiles with theos on http://uv.howett.net/ipf.html. Start over there.<br>
You can learn how to do nic templates on http://theos.howett.net/nic/.
 
== Getting Help ==
 
If you need further assistance, or if you have other questions about Theos itself, feel free to connect to #theos on irc.saurik.com using your preferred IRC client. If you don't already have a preferred IRC client, you can learn more here: [[IRC]].

Latest revision as of 07:05, 8 January 2022

Error creating thumbnail: File missing

https://theos.dev/install

This article is obsolete, and has been replaced by the theos.dev website.

If you need historical installation instructions, you can find the last version of this article here.