# PlexConnect on aTV2/jailbroken -\> launchctl

**URL:** <https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028>\
**Category:** Apps & Creations\
**Created:** [December 7, 2013, 8:04pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028 "2013-12-07T20:04:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [December 7, 2013, 8:04pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/1 "2013-12-07T20:04:26Z")

</div>

In reference to...&nbsp;[https://forums.plexapp.com/index.php/topic/72129-new-hack-running-the-plexconnect-python-script-on-your-jailbroken-atv2/?hl=%2Bnew+%2Bhack](https://forums.plexapp.com/index.php/topic/72129-new-hack-running-the-plexconnect-python-script-on-your-jailbroken-atv2/?hl=%2Bnew+%2Bhack)

&nbsp;

Here is the thing:

With the support for the native client seemingly ceased and our improvements in running PlexConnect all over the world (OSX, Win, Linux,... directly or as daemon...) I took another look into "installing" PlexConnect on my aTV2.

Reusing most of the OSX launchctl stuff I was finally able to make it - it stays there, even after a reboot. No ssh and stuff required. :-D

&nbsp;

There still are some rough edges that need work...

a.) Still hijacking Trailers. Though we should be able to add a nice new icon.

&nbsp; &nbsp; &nbsp;-\>&nbsp;ExtraInternetCategories.plist, bag.plist,... wahlman, jdilinger?

&nbsp;

b.) With the OSX plist, launchctl dies at startup, when spawning the WebServer secondary processes

&nbsp; &nbsp; &nbsp;-\> sys.stdout.flush() doesn't work as stdout is - aeh - nothing?

Is this a limitation of iOS (5.2.x)? Or python 2.7.3 - nothing newer available?

Any iOS developers around with background information?

&nbsp;

Currently I got it fixed with adding

&nbsp;

StandardOutPath

./PlexConnect\_stdout.log

StandardErrorPath

./PlexConnect\_stderr.log

to the plist... but then it creates those two files... :-(

&nbsp;

c.) there must have been a third issue, but I forgot...

&nbsp;

Installation...

source files attached, unzip and add to latest PlexConnect/support/iOS (aTV jailbreak)

&nbsp;

- install python on aTV: eg [https://forums.plexapp.com/index.php/topic/72129-new-hack-running-the-plexconnect-python-script-on-your-jailbroken-atv2/?p=416888](https://forums.plexapp.com/index.php/topic/72129-new-hack-running-the-plexconnect-python-script-on-your-jailbroken-atv2/?p=416888)

- SFTP into aTV and copy the complete directory to /Application/PlexConnect. Or somewhere else, whatever you prefer

- SFTP PlexConnect/support/iOS\*/Settings.cfg to PlexConnect/Settings.cfg, overwriting the later if already there. We need some settings changed, like disabling the DNSServer.

- add PlexConnect/support/iOS\*/hosts\_addon\_PlexConnect to /etc/hosts

- option: add&nbsp;PlexConnect/support/iOS\*/hosts\_addon\_preventATVUpdate as well

- SSH into aTV, "cd /Application/PlexConnect", run "./support/iOS\*/install.bash"

- check with "ps -ef". You should find 3 Phyton/PlexConnect related processes

- check with "launchctl list | grep .plexconnect.". You should get " &nbsp;- &nbsp;com.plex.plexconnect.bach.plist"

&nbsp;

Usage...

Just hit the Trailers app!

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 9:46pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/2 "2013-12-07T21:46:45Z")

</div>

If we could host a bag.plist pointed at our pms on the atv2 that would be ideal. Then we could host the images as well and have a seperate app for plexconnect :). Fire up addsite point it at [http://127.0.0.1/bag.plist](http://127.0.0.1/bag.plist) or whatever. Let me try this and see what I can come up with. Then we could close ports 80 & 53 & our webserver port since its all on the atv 🙂 only the pms port would need to be open with allow with auth wanip(s) if you take your atv from place to place since the atv hosts plexconnect.

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [December 7, 2013, 10:07pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/3 "2013-12-07T22:07:07Z")

</div>

> If we could host a bag.plist pointed at our pms on the atv2 that would be ideal. Then we could host the images as well and have a seperate app for plexconnect :). Fire up addsite point it at [http://127.0.0.1/bag.plist](http://127.0.0.1/bag.plist) or whatever. Let me try this and see what I can come up with. Then we could close ports 80 & 53 & our webserver port since its all on the atv :) only the pms port would need to be open with allow with auth wanip(s) if you take your atv from place to place since the atv hosts plexconnect.

Why do you need the PMS to allow the WAN IP, MYPlex takes care of this automatically.

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 10:08pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/4 "2013-12-07T22:08:47Z")

</div>

Only if you want configured channels, otherwise myplex would work as well minus configured channels. This is just my preference as the images show on this post:

[https://forums.plexapp.com/index.php/topic/86031-plexconnect-on-the-go-atv23-no-jailbreak/](https://forums.plexapp.com/index.php/topic/86031-plexconnect-on-the-go-atv23-no-jailbreak/)

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [December 7, 2013, 10:15pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/5 "2013-12-07T22:15:38Z")

</div>

> Only if you want configured channels, otherwise myplex would work as well minus configured channels. This is just my preference as the images show on this post:
> 
> [https://forums.plexapp.com/index.php/topic/86031-plexconnect-on-the-go-atv23-no-jailbreak/](https://forums.plexapp.com/index.php/topic/86031-plexconnect-on-the-go-atv23-no-jailbreak/)

No channel access for owned servers is not a limitation of MyPlex, it is merely because it has not been implemented.

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 10:17pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/6 "2013-12-07T22:17:11Z")

</div>

Heck if that was implemented on myplex that would be great :) No more needing to allow without auth on pms sounds good to me, is it also possible to put our library in the library tab when running myplex? You can call it myplexgo lol, just kidding obviously.

Ok back to trying to get this to work with addsite. Also if we could get a a web server running on the atv, that would be great.

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 10:59pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/7 "2013-12-07T22:59:33Z")

</div>

- SSH into aTV, "cd /Application/PlexConnect", run "./support/iOS\*/install.bash"

I got stuck there permission denied. Then I edited the&nbsp;com.plex.plexconnect.bash.plist to match the ATV directory structure then copied the file over via sftp then changed directory and fixed it up like this:

cd /Library/LaunchDaemons

chown root:wheel&nbsp;com.plex.plexconnect.bash.plist

chmod 644&nbsp;com.plex.plexconnect.bash.plist

launchctl load&nbsp;com.plex.plexconnect.bash.plist

When I ran the command:

launchctl list | grep.plexconnect

it says command not found any ideas?

When I try to re-run lauchctl load com.plex.plexconnect.bash.plist it says already loaded. Here are some other errors that I&nbsp;can't figure out as well.

atv-:/Applications/PlexConnect root# ./PlexConnect.py

-sh: ./PlexConnect.py: Permission denied

atv-:/Applications/PlexConnect root# ./PlexConnect\_daemon.bash start

-sh: ./PlexConnect\_daemon.bash: Permission denied

&nbsp;

Do I need to change the password from alpine first? Didn't help using&nbsp;passwd to try to change it.

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:21pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/8 "2013-12-07T23:21:49Z")

</div>

trying ur thing here Baa.. but am having trouble with the python thing.. i did get it to start and show up once.. but after reebot its gone again when i type the ssh commands to look for it.. any ideas? when i try to do the bash install again it says its already installed so..

wahlman.. i had no problem installing it with the standard alpine psw

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 11:22pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/9 "2013-12-07T23:22:13Z")

</div>

nevermind, I read your post incorrectly.

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [December 7, 2013, 11:23pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/10 "2013-12-07T23:23:30Z")

</div>

> Ok back to trying to get this to work with addsite. Also if we could get a a web server running on the atv, that would be great.

  
Um one of the main components of PlexConnect is a webserver, this is how you can load the cert profile just using PlexConnect and the ATV remote and how PlexConnect serves up the code to the ATV.

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 11:26pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/11 "2013-12-07T23:26:00Z")

</div>

I guess what I'm trying to say there is can I add a bag.plist like I do via addsite like this 127.0.0.1/bag.plist. On my mac I host 192.168.1.101:1234/bag.plist using a webserver when I add the bag.plist via addsite on the ATV2. Can plexconnect's webserver do that on the ATV2?

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [December 7, 2013, 11:27pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/12 "2013-12-07T23:27:17Z")

</div>

Maybe…

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:29pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/13 "2013-12-07T23:29:10Z")

</div>

wohaa got it working.. the problem was the certs (rookie mistake)

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 11:30pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/14 "2013-12-07T23:30:50Z")

</div>

That would be great, then we could move away from this and just use addsite since this is a atv2 only solution anyways. Maybe it will make things a little easier, I don't know for sure. Im sure we can make a stupid easy bash script to automate the process.

@stoffez can you pm me your plexconnect folder in a zip so I can look at it as well as any other edited files you used? :)&nbsp;I don't know where I'm dropping the ball here.

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:34pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/15 "2013-12-07T23:34:24Z")

</div>

muhhaaa got the addsite working aswell... now when it points to 127.0.0.1 you can juts put this in your hosted bag file

[http://127.0.0.1/Applications/PlexConnect/assets/js/application.js](http://127.0.0.1/Applications/PlexConnect/assets/js/application.js)

then u get away from that thing where u havto change the ip everytime the ATV ip changes.. now if i could just free up the trailers app then we are good to go

dont solve the (must have a webbserver issue to use addsite) but its a step in the right direction :D

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 11:35pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/16 "2013-12-07T23:35:37Z")

</div>

It should be easy to implement a different app using addsite with a custom bag.plist. So I'm confused you can point at a bag.plist on the ATV2 or no? What iOS are you running by the way.

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:36pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/17 "2013-12-07T23:36:32Z")

</div>

i just did.. i have the plex connect app right now.. just trying to fix so i can use trailers app as usuall to :D

---

<div class="post-metadata">

**Author:** ![wahlman.j](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wahlman.j/32/6441_2.png) [@wahlman.j](https://forums.plex.tv/u/wahlman.j)\
**Post date:** [December 7, 2013, 11:36pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/18 "2013-12-07T23:36:58Z")

</div>

Just set dns to auto, you must send me your folder in a zip, please o please, or host it on your web server so I can look at it. ;)

How the heck did you get past that step I'm stuck on. If you can get me to where your at I can write up a easy how to and add addsite bash scripts to automate this. More progress on the ATV2 side, to bad for atv3 owners, I'm trying to fix adsite but I cannot host a bag.plist via https:

[https://forums.plexapp.com/index.php/topic/81972-installing-a-new-app-on-appletv-without-hijacking-trailers/page-21](https://forums.plexapp.com/index.php/topic/81972-installing-a-new-app-on-appletv-without-hijacking-trailers/page-21)

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:37pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/19 "2013-12-07T23:37:41Z")

</div>

i have it on auto.. in digging into the host file..think thats where the prob is :)

---

<div class="post-metadata">

**Author:** ![Stoffez](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/stoffez/32/98459_2.png) [@Stoffez](https://forums.plex.tv/u/Stoffez)\
**Post date:** [December 7, 2013, 11:39pm UTC](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028/20 "2013-12-07T23:39:07Z")

</div>

yup that was it :D the on the go now works :DDD

[Next page](https://forums.plex.tv/t/plexconnect-on-atv2-jailbroken-launchctl/49028.md?page=2)
