Inspecting an archived app, I can see the full path listed for a few source code files in the app binary. Not all source code files are listed.
strings - the_binary_app | grep "\.m"
reveals
/Users/bbarnhart/myPath/myPath/App/path/path/SourceCodeFile.m
as well as a few others. I can not determine how the full paths for a few source code files are embedded in the app binary. I would like to remove them. Any ideas? Is this a build setting or is the project file slightly corrupted?
Some belong to a lib and others are files that belong to the project.
What is iOS app development? iOS application development is the process of making mobile applications for Apple hardware, including iPhone, iPad and iPod Touch. The software is written in the Swift programming language or Objective-C and then deployed to the App Store for users to download.
Before you write a single line of code in the iOS app development process, you need: 1 An Apple Mac computer running the latest version of macOS. 2 Xcode, which is the integrated development environment (IDE) for macOS, available as a free download from the Mac App... 3 An active Apple Developer account, which requires a $99 annual fee. More ...
Xcode runs only on macOS, and macOS runs only on Apple computers. The good news is that Xcode offers much more than just the ability to sign and publish your completed app. The IDE contains a user interface designer, code editor, testing engine, asset catalogue and more—virtually everything you need for iOS app development.
Additionally, the local file provider grants access to all the documents in the app’s Documents directory. These documents appear in the Files app, and in a Document Browser. Users can open and edit these document in place. This key is supported in iOS 11 and later.
The __FILE__
macro expands to full path to the current file. This is one likely way you might be getting the paths into your executable. For example, the expansion of the assert
macro includes the __FILE__
macro.
Look at the output of your strings | grep
pipeline. For each of those files, go into your project in Xcode and open that file. Then go to the Related Files doodad and choose “Preprocess”:
Then search through the preprocessor output for the file's path. You will find lots of false positives, because there will be lots of #
line number/path directives. You can ignore these, because they only produce debug output, which is not included in your executable file (unless you've done something weird with your build settings). You might find it faster to save the preprocessor output to a file, then open that file and pipe it through grep
or use a regexp search/replace to delete all lines starting with #
.
Find the other instances where your path appears as a string constant. For example, if you used the assert
macro, you will find something like this:
(__builtin_expect(!(argc > 0), 0) ? __assert_rtn(__func__, "/Volumes/b/Users/mayoff/TestProjects/textViewChanged/textViewChanged/main.m", 16, "argc > 0") : (void)0);
That's a case where the path will end up embedded in your executable.
If that doesn't find all the places where you're embedding your path, try selecting “Assembly” from the Related Files doodad. The assembly will be full of comments containing your path; everything after @
is a comment in the assembly output, so ignore those.
You will also see your paths in .file
directives. I believe these only produce debug symbol output, which doesn't go into your executable, so you can ignore those too.
You will also see your paths in .asciz
directives shortly after .section DWARF,...
directives. This is more debug symbol stuff that you can ignore.
Look for the remaining cases where your path appears in the assembly output. You need to figure out how to eliminate these cases. How you do that will depend on the context in which the paths appear, so if you need more help, update your question with what you find.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With