On my '88 4-Runner after replacing the master cylinder (twice), brake booster (twice), rear shoes and cylinders, adjusting emergency brake cable and completely bleeding system 3 times, (front rotors & disks have very little mileage on them), I have the following problem; I have good petal when the motor, (4-cyl), is off and no petal with the motor running, (no brakes)! Where do I look for the fix?
It still sounds like you have air in the system.
There are a few ways the air can still be trapped in the system.
When you changed the master cylinder did you bleed the master cylinder before you installed it in the truck?
This may sound stupid but it is possible that the calipers were installed on the wrong side. If you look at the caliper, the bleeder valve should be higher than the brake hose. This will ensure that all the air will get out of the caliper.
There may be an adjustment for the push rod depth on the master cylinder. It is possible that the master cylinder is not the same as the original. There seems to be two master cylinders for the truck, one has a deeper depth for the power booster push rod then the other. Make sure you have the proper master cylinder for your truck.
After bleeding the master cylinder, put a rubber tube on the bleeder valve on the right rear cylinder, put the other end inside a bottle. As you pump the pedal the bottle will fill up with fluid, close the bleeder valve when there are not anymore bubbles coming out of the hose submerged in the bottle. Then go to the left rear and do the same thing. Do this to all the wheels and then check the pedal.
Try these suggestions and get back to me with your results. We can go on from there.