By Benjamin Pimentel, MarketWatch

SAN FRANCISCO (MarketWatch) -- Apple and Twitter shares rallied to give the technology sector a boost Tuesday, even as the group was weighed down by slumping shares of Microsoft and Google.

Apple (AAPL) rose 1.4% to close at $637.54 a day after the iPhone maker unwrapped new software initiatives at its developer conference in San Francisco.

Susquehanna analyst Chris Caso raised his price target for Apple to $725 from $650, and said the company's software announcements are "mostly evolutionary changes that continue to strengthen the Apple ecosystem."

Twitter (TWTR) gained 2.6% to close at $32.58, as the social network's stock turned positive for the week. Twitter is still down nearly 50% year-to-date.

Chip stocks also were mostly up, with shares of Broadcom Corp. (BRCM) gaining 3% to close at $35.88 and Intel Corp. (INTC) up 1.5% to close at $27.66. The Philadelphia Semiconductor Index (SOX) edged higher by 1%.

But the Nasdaq Composite Index (RIXF) was down 0.1% to close at 4,234. Among the notable decliners were Google Inc.(GOOGL), which slipped 1.7% to close at $554.51, and Microsoft Corp.(MSFT), which shed 1.2% to close at $40.29.

More must-read stories from MarketWatch:

Apple rolls our a more combative CEO

In Silicon Valley, even the young turn to cosmetic surgery to looks smart

Subscribe to WSJ: http://online.wsj.com?mod=djnwires