Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:31:13+00:00 2026-05-28T00:31:13+00:00

I am trying to write file to the root partition of the device. It

  • 0

I am trying to write file to the root partition of the device. It is a Jailbreak app so it is installed in /Applications. When writing to the root filesystem using NSFileManager the write fails with a “Permission Denied” error.

It seems like my app is not running as root. It is installed in /Applications though. How can my app become root?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:31:14+00:00Added an answer on May 28, 2026 at 12:31 am

    It is true, the app has to run as root to access non mobile directories. After discussing this with Optimo and Saurik I finally found the right way to get root privileges.

    1. In the main() function add setuid(0); and setgid(0);
    2. Build the app normally.
    3. Create a copy of the executable file in the app bundle.
    4. Open the original executable file and replace its content with this script:

      #!/bin/bash
      dir=$(dirname "$0")
      exec "${dir}"/COPIED_EXECUTABLE_NAME "$@"
      

      Directly launching a root app fails on iOS. Therefore we replace the app’s main executable with a script that launches the root executable.

    5. In terminal, navigate to the app bundle.

    6. chmod 0775 the original executable file and chmod 6775 the copied executable file.
    7. Copy the app bundle to /Applications to a device. Restart SpringBoard and you should be good to go. If the app doesn’t launch then repeat step 5 & 6 on the device.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a file in android using phonegap cordova 1.5.0. Below
I'm trying to write an INI file using the WritePrivateProfileString and WritePrivateProfileStruct functions. I
I'm trying to write an xml file with utf-8 encoded data using ElementTree like
I'm trying to write an Android 2.2 app that will find installed apps that
I am trying to write a file, generated by my app, onto the system
I'm trying to write to an XML file using Builder but cannot seem to
I am trying to write an uploaded multipart file to the filesystem. I have
I am trying to write header file. I can write simple headers like add(int
I'm trying to write a file from an Http post reply to a file
I am trying to write a file to the external storage location on Android.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.