Tag Archives: ios

Jenkins ios rror: No signing certificate “iOS Distribution” found: No “iOS Dist…

The error prompt is as follows:

error: No signing certificate "iOS Distribution" found: No "iOS Distribution" signing certificate matching team ID "YQL2NV3V7T" with a private key was found. (in target 'HelloWorld')

** ARCHIVE FAILED **

The answers found on the Internet are all like this. It doesn’t work even if you try

Jenkins encountered problems in automatically building IOS package signature

Solution:

Before compiling, add security unlock Keychain – P “your password” “path to Keychain/login. Keychain”

The root cause is Jenkins, SSH mode to slave machine, default is no account, but access to the key chain must have user identity, so add a step to enter the password to unlock the key chain, you can give Jenkins a user identity. Add a step to unlock the key chain before the build step. security unlock-keychain -p “login pwd” ~/Library/Keychains/login.keychain

 

 

Modification process:

It’s a matter of system user rights

I put Tomcat + Jenkins in the root directory

However, the certificate configured by Xcode is in a subdirectory under login user/user/Wangju

Then start Jenkins. The. Jenkins directory is also generated in the/user/Wangju directory

It’s not easy to use many methods. Finally, I moved Jenkins’ installation directory to/user/Wangju/Library Directory

start Tomcat again, log in Jenkins , execute the packing command, and the amazing thing is that the packing is successful. Now it’s still a bit confusing, but it’s finally solved this problem. I want to cry when I see that I can type the xcatchive file. From about 7 pm yesterday to 11 pm, I have been thinking about this problem, and then to 11 pm today, it’s almost 7 hours, and I finally don’t need to re install the system to get it done. Let’s have a good time

Attach a path of Tomcat startup file

This problem is repeated again, and the solutions are as follows:

CD to Tomcat file installation directory

Stop Tomcat service

Start Tomcat service

After restarting tomcat, the Java icon appears on the desktop. It’s strange that Jenkins can also be used before, but there is no Java icon on the desktop?It is suspected that there is something wrong with the way I started tomcat, so after the computer was restarted, Jenkins packaging was affected

It seems that this is the reason

note: when I use launch to start tomcat, the program execution is normal, but I can’t start the service, and the permission modification is done, but it’s still useless

———————-Dividing line———————-

In addition, I also changed the permissions of the user directory where the certificate is located. I don’t know if there is such a reason

Select system preferences & gt> Sharing can be configured

 

I also moved these files in the directory of/user/xxx/library/keychains to the directory of/var/root/library/keychains. I tried, but it didn’t seem to work. Finally, I deleted the copied files

Now I don’t know which step affects the final result after so many operations, but if I encounter the problem of IOS packaging again, I will definitely not change the system configuration file (before configuration, I changed the Mac computer name, administrator user name and home directory, but it’s strange that I changed the administrator user name to ABC, CBA is always displayed on the command line. I don’t know if this is the cause of my configuration error. User rights, etc.)

I think this kind of answer may also be OK, but I didn’t try

Note: the password can be added to the credential. If Jenkins is downloaded from the root user, please change/etc/sysconfig/Jenkins to root, otherwise an error will be reported; Or create a new ordinary user, and modify it

Then restart: Service Jenkins restart

Bridging mechanism of toll free bridging in IOS

Toll free bridging, referred to as TFB, is a mechanism that allows some objc classes and their corresponding corefoundation classes to be used interchangeably. For example, nsstring and cfstring are bridged, which means that any nsstring can be used as a cfstring, or any cfstring can be used as an nsstring

There are a number of data types in the core foundation framework and the foundation framework that can be used interchangeably. This capability, called toll free bridging, means that you can use the same data type as the parameter to a core foundation function call or as the receiver of an Objective-C message

The principle (take nsstring as an example) is: nsstring is an abstract class. Whenever you create an instance of nsstring, it is actually a private subclass instance of nsstring. One of the private subclasses is nscfstring, which is the corresponding class of cfstring class in objc. Nscfstring implements all the methods needed as an nscfstring

My understanding: in short, you know that there is a toll free bridging mechanism, and nscfstring is a private subclass of nsstring, which implements all its methods. See the official website for detailed explanation

Why cfstring

Explanation on the official website:

CFString provides a suite of efficient string-manipulation and string-conversion functions. It offers seamless Unicode support and facilitates the sharing of data between Cocoa and C-based programs

On this point, I also recommend a better blog post:

Toll Free Bridging

Xcode Error: Command CodeSign failed with a nonzero exit code

Some solutions on the Internet are: Command + K, and then restart the computer. Just run it again.

But it is invalid for me. My reason is that the system library import location of accounts. Framework (the part circled in red below) is wrong. So I deleted the library and re imported it to run normally.

How to delete and add: select targets – & gt; build phases–> Link binary with libraries, find the corresponding library (I’m here accounts. Framework), click minus sign to delete, and click plus sign to add.

 

Xcode Command PhaseScriptExecution failed with a nonzero exit code

1.Problem description

Use Xcode to write code. During the process of compiling new project code, the following error has been reported all the time.

Command PhaseScriptExecution failed with a nonzero exit code

After searching on the Internet, most of the solutions given on the Internet are as follows. However, after I tried, the problem was not solved, but more errors were reported. Therefore, I asked my tutor and finally got the solution.

When running a project, I encountered this bug prompt. I can’t compile it all the time. This is actually a bug caused by xcode10. Solution: in the Xcode menu bar, select File – > Workspace Setting -> Build system select legacy build system to run again.

The main reason for this problem is that the workspace is full, which leads to errors in code compilation. There are two ways to solve this problem.

(1) Enter Xcode’s code work cache folder for manual cleaning (error prone, not recommended)

(2) Just use the cleaning method provided by Xcode. After Xcode cleans up the workspace, it will automatically link the working files (no error, recommended)

Because the second method is relatively easy to operate and is unlikely to make mistakes, we directly use this method to solve the problem.

2.Solutions

1. First, in product – > Select the main code module of the current project in scheme

2. Select product – > Clean build folder cleans up the workspace

3. Recompile the project code later

Resolve VirtualBox error: “fat: no bootable medium found!”

I was installing win10 virtual machine with VirtualBox in unbuntu16.04. I encountered the above problems, and the solutions on the Internet were all wrong. Similar to the following question.

My solution is to put the IOS files you need to load forward as far as possible when allocating the CD-ROM ports, followed by. DVI.

The problem of personal test can be solved.

fatal:No bootable medium found! System halted

It means

Fatal: not found in boot! Crash

First, the system may be forced to shut down before the installation is completed

The second root operation is to delete system files

Third, improper use habits, should let the system shut down normally rather than directly point x forced shutdown

Reason: the image file system could not be found, and the image file could not be found
in the system

In fact, it’s very simple. Select the corresponding system, and then click settings. Operate according to the figure below, click OK, and then start

How to Solve Control reaches end of non-void block

When using afn3.0

setDataTaskDidReceiveResponseBlock:

We made the following mistakes

Control reaches end of non-void block 。

This block should have a return value, but you didn’t report an error.

The specific uses are as follows:

    AFHTTPSessionManager *httpMgr = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
    
    NSURLSessionDataTask *task = [httpMgr HEAD:[self.url absoluteString] parameters:nil success:^(NSURLSessionDataTask * _Nonnull task) {
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
    //By default, when the server response is received, the server thinks the client does not need to receive data, so the proxy method will not be called afterwards
    // If you need to continue receiving data from the server, then you need to call block, and pass in the corresponding policy

    /*
        NSURLSessionResponseCancel = 0, Cancel task
        NSURLSessionResponseAllow = 1, Receive task
        NSURLSessionResponseBecomeDownload = 2, turn into a download
        NSURLSessionResponseBecomeStream NS_ENUM_AVAILABLE(10_11, 9_0) = 3, turn into a stream
    */

    [httpMgr setDataTaskDidReceiveResponseBlock:^NSURLSessionResponseDisposition(NSURLSession * _Nonnull session, NSURLSessionDataTask * _Nonnull dataTask, NSURLResponse * _Nonnull response) {
      // If the NSURLSessionResponseDisposition method is not returned here, this error will be reported
       // Solution Pass in the corresponding policy e.g.
        return NSURLSessionResponseBecomeDownload;
    }];

Or when using AFN’s download task:

    [sessonMgr downloadTaskWithRequest:[NSURLRequest requestWithURL:self.url] progress:^(NSProgress * _Nonnull downloadProgress) {
        
    } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
       // This error will also be reported if the stored directory is not returned here.
        return [NSURL URLWithString:self.destPath];
    } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {

    }];

This question is answered on stackOverFlow: http://stackoverflow.com/questions/29631817/ios-objective-c-blocks-warning-control-reaches-end-of-non-void-function

How to view jetsamevent log of APP in IOS

1. How to view it on iPhone

Set up – General – analyze – analyze data – jetsamevent + log to start the system log.

2. How to view this kind of analysis log on MAC

1. Mobile link MAC

2

2. Open iTunes and click the phone icon

2

3. Click the sync button

3

The log will be synchronized to the following directory in MAC/users/username/library/logs/crashreporter/mobiledevice/

3. Analysis of logs:

Jetsamevent can help us check the memory usage of APP cleaned by the system.

{"bug_type":"298","timestamp":"2019-04-18 00:41:32.72 +0800","os_version":"iPhone OS 11.3.1 (15E302)","incident_id":"65385412-FCF1-4F8B-B9BA-7E3457FA2C43"}
{
  "crashReporterKey" : "cb1b46c9b29603987f13d3af5624dfe0891dcd8b",
  "kernel" : "Darwin Kernel Version 17.5.0: Tue Mar 13 21:32:11 PDT 2018; root:xnu-4570.52.2~8\/RELEASE_ARM64_T8010",
  "product" : "iPhone9,1",
  "incident" : "65385412-FCF1-4F8B-B9BA-7E3457FA2C43",
  "date" : "2019-04-18 00:41:32.67 +0800",
  "build" : "iPhone OS 11.3.1 (15E302)",
  "timeDelta" : 5,
  "memoryStatus" : {
  "compressorSize" : 50024,
  "compressions" : 79275112,
  "decompressions" : 61573914,
  "zoneMapCap" : 402653184,
  "largestZone" : "APFS_4K_OBJS",
  "largestZoneSize" : 13451264,
  "pageSize" : 16384,
  "uncompressed" : 120159,
  "zoneMapSize" : 113508352,
  "memoryPages" : {
    "active" : 29786,
    "throttled" : 0,
    "fileBacked" : 15361,
    "wired" : 26461,
    "anonymous" : 29604,
    "purgeable" : 33,
    "inactive" : 13602,
    "free" : 2391,
    "speculative" : 1577
  }
}
...
,
  "largestProcess" : "JD4iPhone",
  "genCounter" : 1,
  "processes" : [
  {
    "uuid" : "89715e1a-af5d-3c31-920a-b842f063e8be",
    "states" : [
      "daemon",
      "idle"
    ],
    "lifetimeMax" : 235,
    "age" : 1270330434891,
    "purgeable" : 0,
    "fds" : 50,
    "coalition" : 366,
    "rpages" : 115,
    "pid" : 19692,
    "idleDelta" : 3632517,
    "name" : "revisiond",
    "cpuTime" : 2.8573390000000001
  },

...

{
    "uuid" : "616cc66b-7c0b-3bd5-89ff-af63bd94dbb7",
    "states" : [
      "suspended"
    ],
    "lifetimeMax" : 14774,
    "age" : 82573963110,
    "purgeable" : 0,
    "fds" : 100,
    "coalition" : 4389,
    "rpages" : 10898,
    "pid" : 20571,
    "idleDelta" : 14614331251,
    "name" : "JD4iPhone",
    "cpuTime" : 268.98448000000002
  },

This is part of the jetsamevent log generated by iPhone 7. You can basically guess the meaning of the following log: “largestprocess”: “jd4iphone”, which means that jd4iphone uses the most temporary memory. If you don’t guess wrong, it should be JD app.

It occupies a memory page of “rpages”: 10898, “PageSize”: 16384, the size of each page is 16384/1024 = 16K, so the memory temporarily used by this application is 10898 * 16K = 170m “states”: [“suspended”], and its status is suspended.

The process of “UUID”: “89715e1a-af5d-3c31-920a-b842f063e8be” is idle, and it is a guard thread, which is generally maintained by the system. Although it only takes up “rpages”: 115, 115 memory pages.

4. Single application maximum available memory value of different models of mobile phones

Research on IOS oom principle of APP maximum memory usage limit