Use LLDB on a non-jailbreaking device to debug a third-party App, lldbapp

Source: Internet
Author: User

Use LLDB on a non-jailbreaking device to debug a third-party App, lldbapp
Description
This method was created when iOS 8 was just released. At that time, it was mainly used to debug and analyze apps on non-jailbroken iOS 8 devices that third parties already support iOS 8, such as UC browser, the following uses UCWEB as an example to describe some commands.
Why do we need to perform such debugging?

Principle
I can't talk about the principle. I mainly use xcode's tool chain. Of course, if I am familiar with certificates, signatures, and Entitlements, I may naturally think of this method. After thinking of the method at that time, I searched on github and found that some related tools have been written. Next I will explain how to perform this operation.
Tools
Ios-deploy: https://github.com/phonegap/ios-deploy
Environment
1. OS X Yosemite-10.10.2, xcode-6.1.1
Procedure
1. Configure the command line environment of xcodeSuch:


Note: The iOS system version supported by xcode must be greater than or equal to that of the device. Otherwise, the debugging tool cannot be mounted.
2. Check out the tool: Git clone https://github.com/phonegap/ios-deploy
3. Compilation tools, Shell to go To the ios-deploy directory, directly make:

After compilation, you can copy ios-deploy to/usr/local/bin for global use.
4. decrypt a third-party App on the jailbreak DeviceYou can also use Clutch. This step is important. An error will be reported if you are not confused. The specific cause is not investigated. Applications installed on devices during development and debugging are not encrypted.

5. Permission Entitlements:

<?xml version="1.0"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>get-task-allow</key><true/></dict></plist>

Save the preceding content as Entitlements. plist, which is required for subsequent signature.


6. Prepare the mobileprovision File, Which can be downloaded from iOS Dev Center. The mobileprovision file must contain the target device, which should be known for iOS development. You can use emacs to open the mobileprovision file and check whether the device's udid is in the file. Rename the downloaded mobileprovision to embedded. mobileprovision, and copy the renamed file to UCWEB. app:

7. Run the following command to re-sign the signature.:
Codesign-f-s "iPhone Developer: Your Certificate Name" -- entitlements Entitlements. plist UCWEB. app

8. Run the following command to start debugging:, Unlock the screen before debugging:
Ios-deploy-v-d-n-I "do not set UDID"-B UCWEB. app

Note: The application installation process is long. If successful, the status is as follows:
9. Set the breakpoint and run the program:

10. There is no difference between other remote debugging methods and normal lldb, enjoy.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.